¡@

Home 

c# Programming Glossary: collsize

Why is ConcurrentBag<T> so slow in .Net (4.0)? Am I doing it wrong?

http://stackoverflow.com/questions/4785622/why-is-concurrentbagt-so-slow-in-net-4-0-am-i-doing-it-wrong

huge difference private static void ConcurrentBagTest int collSize 10000000 Stopwatch stopWatch new Stopwatch ConcurrentBag int.. bag1 new ConcurrentBag int stopWatch.Start Parallel.For 0 collSize delegate int i bag1.Add i stopWatch.Stop Console.WriteLine.. secs of this code private static void LockCollTest int collSize 10000000 object list1_lock new object List int lst1 new List..