in-memory

Is it possible to run tests on an in-memory assembly?

吃可爱长大的小学妹 提交于 2021-02-10 14:25:42
问题 I am currently building a mutationtest framework for .NET. I want to run the unit tests from a project on an in-memory assembly. This way the mutated assembly won't have to be writen to disk and my framework will be faster to use. Using the Roslyn compiler in .Net Core 2.0 I mutate (change) the syntaxtree and compile it into an in-memory assembly like this: Assembly assembly = AssemblyLoadContext.Default.LoadFromStream(ms); Does anyone know of a way to unit test this assembly without writing

Docker: in memory file system

◇◆丶佛笑我妖孽 提交于 2020-12-27 17:12:41
问题 I have a docker container which does alot of read/write to disk. I would like to test out what happens when my entire docker filesystem is in memory. I have seen some answers here that say it will not be a real performance improvement, but this is for testing. The ideal solution I would like to test is sharing the common parts of each image and copy to your memory space when needed. Each container files which are created during runtime should be in memory as well and separated. it shouldn't

Docker: in memory file system

别等时光非礼了梦想. 提交于 2020-12-27 17:03:50
问题 I have a docker container which does alot of read/write to disk. I would like to test out what happens when my entire docker filesystem is in memory. I have seen some answers here that say it will not be a real performance improvement, but this is for testing. The ideal solution I would like to test is sharing the common parts of each image and copy to your memory space when needed. Each container files which are created during runtime should be in memory as well and separated. it shouldn't

Streaming video in memory with OpenCV VideoWriter and Python BytesIO

半城伤御伤魂 提交于 2020-06-13 00:16:42
问题 I was wondering if it is possible to 'stream' data using the OpenCV VideoWriter class in Python? Normally for handling data in memory that would otherwise go to disk I use BytesIO (or StringIO). My attempt to use BytesIO fails though: import cv2 from io import BytesIO stream = cv2.VideoCapture(0) fourcc = cv2.VideoWriter_fourcc('x264') data = BytesIO() # added these to try to make data appear more like a string data.name = 'stream.{}'.format('av1') data.__str__ = lambda x: x.name try: video =

Multi Indexed in Collection with O(1) searching time

不羁岁月 提交于 2020-01-17 07:40:50
问题 Suppose I want to make one Collection of Class which have 10 properties, This collection holds about 10 million items. Now I want to search this collection with O(1) time complexity or near to O(1) by any property of Class.(Not by only one property i.e ID or Name) If I use List than it by LINQ query it will require O(n) time complexity, So it can't be used. C# have dictionary which can be indexed by only one key type. So it also can't be used. As one solution I can make 10 Dictionaries

Where to order a result set randomly - in database or in memory?

放肆的年华 提交于 2020-01-15 10:40:11
问题 Data source will contain approx. 5000 records. I know that it is possible to order data randomly with orderby newid() . But data to be sorted should be paged. That means page n can not contain records from previous pages (n-1, n-2 etc). Now I think I have 2 ways to go: ordering in database, or in memory (because 5000 records is small enough to hold it in in-memory cache). For option 1 (sorting in db) I am not sure if it's possible because data should be paged. Is it possible if yes how? For

sqlite in-memory db and multithreading

淺唱寂寞╮ 提交于 2020-01-01 15:33:49
问题 My application creates a in-memory database (:memory:) using sqlite as a back end. I want my master thread to create a connection to a in-memory database and this connection to be shared by multiple threads. Is this possible? SQLite 3.7.8 is available for download right now. Is the shared cached a possible way to go? 回答1: If you open the connection to your in-memory database using serialized mode, then the connection may be shared among multiple threads. For this to work, your SQLite must be

how to build a in-memory server side cache in php?

冷暖自知 提交于 2020-01-01 10:48:12
问题 I am trying to reduce the amount of database access by providing a in memory cache. I understand that I can get a cache by using session and cookies, however this only works on a per client basis. if the same query is made once in every session, then the cache will be useless. But I only want to access the database once and have it cached. Is there a way to make create a cache in memory that can be accessed by the server side script? I don't want to store the cache data in a file .. 回答1: You

Random error when testing with NHibernate on an in-Memory SQLite db

筅森魡賤 提交于 2019-12-23 07:47:43
问题 I have a system which after getting a message - enqueues it (write to a table), and another process polls the DB and dequeues it for processing. In my automatic tests I've merged the operations in the same process, but cannot (conceptually) merge the NH sessions from the two operations. Naturally - problems arise. I've read everything I could about getting the SQLite-InMemory-NHibernate combination to work in the testing world, but I've now ran into RANDOMLY failing tests, due to "no such

In-memory DBMS's for unit testing

喜夏-厌秋 提交于 2019-12-21 12:26:22
问题 I am looking for satisfactory options for unit testing my .NET DAL classes; since they're DAL classes, they access the database directly using ADO.NET. Presently I use an instance of a MSSQL database for the testing, but was wondering what faster options there are---since unit tests need to run as quickly as possible, an in-memory solution would be ideal. I should also mention that I have tied myself to TSQL since I'm only ever going to be using a Microsoft platform. 回答1: Given that you state