Hope this is a valid post here, its a combination of issues and C # hardware.
I am comparing our server because we found performance issues with our quantum library (written in C #). I simulated the same performance issues with a simple C # code that uses memory very much.
Below is the code that is generated from the thread thread, up to a maximum of 32 threads (since our server has 4x CPU x 8 cores each).
It's all on .Net 3.5
The problem is that we get wildly different performance. I run the function below 1000 times. The average time it takes to run the code can be, say, 3.5 s, but the fastest of them will be only 1.2 s, and the slowest - 7 s - for the same function!
I correlated memory usage with timings, and there seems to be no correlation with what the GC uses.
One thing I noticed is that when starting in the same thread, the timings are identical and there is no wild rejection. I also tested processor-bound algorithms, and the timings are identical too. This made us wonder if it could handle the memory bus.
I was wondering if this could be another .net or C # problem, or is it related to our hardware? It will be the same experience if I used C ++ or Java ?? We use 4x Intel x7550 with 32 GB of RAM. Is there any way around this problem in general?
Stopwatch watch = new Stopwatch(); watch.Start(); List<byte> list1 = new List<byte>(); List<byte> list2 = new List<byte>(); List<byte> list3 = new List<byte>(); int Size1 = 10000000; int Size2 = 2 * Size1; int Size3 = Size1; for (int i = 0; i < Size1; i++) { list1.Add(57); } for (int i = 0; i < Size2; i = i + 2) { list2.Add(56); } for (int i = 0; i < Size3; i++) { byte temp = list1.ElementAt(i); byte temp2 = list2.ElementAt(i); list3.Add(temp); list2[i] = temp; list1[i] = temp2; } watch.Stop();
(the code is just designed to emphasize memory)
I would include threadpool code, but we used the non-standard threadpool library.
EDIT: I reduced the size of "size1" to 100000, which basically does not consume much memory, and I still get a lot of jitter. This suggests that it is not the amount of memory transferred, but the frequency of memory capture?