Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › [Benchmark] .NET4 vs Hand-made collections
New Posts  All Forums:Forum Nav:

[Benchmark] .NET4 vs Hand-made collections - Page 2

post #11 of 31
Thread Starter 
Quote:
Originally Posted by killnine View Post
Here's what I would suggest:

1) Post your collections as a library for others on OCN to test
2) Post your collections on stack overflow challenging users to profile your collections and see if they clobber the native collections in their scenarios
3) If 1 & 2 pass with flying colors, apply at MS.
Yep, that was my thinking too The library will be downloadable by the end of the week, i'm very busy with other things now

Thank you for the comments!
My Rig
(14 items)
 
Ex-wife's Rig
(15 items)
 
 
CPUMotherboardGraphicsRAM
Core i5 4460 AsRock H81M-DG4 Sapphire Rx470 Platinum KVR 1600 16Gb 
Hard DriveHard DriveCoolingOS
2x Seagate 3Tb Samsung 850 EVO 120 Scythe Ninja 3 Rev.B Windows 10 Pro 
MonitorKeyboardPowerCase
Fujitsu Siemens A17-2A Logitech K280e SuperFlower SF-550K12XP Thermaltake Versa H25 
MouseAudio
Logitech G402 Sony MDR XD150 
CPUMotherboardGraphicsRAM
Athlon 750K 4.0Ghz AsRock FM2A75 Pro4+ Sapphire R9 270X Dual-X Kingston 2x4Gb 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 850 EVO 120  Western Digital 320Gb LiteON DVD-RW CoolerMaster Hyper Z600 
OSMonitorKeyboardPower
Windows 7 Pro x64 Toshiba 32" FullHD TV Logitech FSP Hexa 550 
CaseMouse
DeLUX Logitech 
  hide details  
Reply
My Rig
(14 items)
 
Ex-wife's Rig
(15 items)
 
 
CPUMotherboardGraphicsRAM
Core i5 4460 AsRock H81M-DG4 Sapphire Rx470 Platinum KVR 1600 16Gb 
Hard DriveHard DriveCoolingOS
2x Seagate 3Tb Samsung 850 EVO 120 Scythe Ninja 3 Rev.B Windows 10 Pro 
MonitorKeyboardPowerCase
Fujitsu Siemens A17-2A Logitech K280e SuperFlower SF-550K12XP Thermaltake Versa H25 
MouseAudio
Logitech G402 Sony MDR XD150 
CPUMotherboardGraphicsRAM
Athlon 750K 4.0Ghz AsRock FM2A75 Pro4+ Sapphire R9 270X Dual-X Kingston 2x4Gb 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 850 EVO 120  Western Digital 320Gb LiteON DVD-RW CoolerMaster Hyper Z600 
OSMonitorKeyboardPower
Windows 7 Pro x64 Toshiba 32" FullHD TV Logitech FSP Hexa 550 
CaseMouse
DeLUX Logitech 
  hide details  
Reply
post #12 of 31
Thread Starter 
The last test (10M, Array, List, my list, LinkedList), repeated with StopWatch, gives same result Here's the log:

STRING TEST /0
Array of 10000000 constructed in 0
List constructed in 0
List PRO constructed in 0
Linked List constructed in 0
Dictionary constructed in 0
Sorted Dictionary constructed in 0
DataHub constructed in 0
Multiple DataHub constructed in 0

Writing to Array..
Writing 10000000 entries to Array took 2261
Writing to List..
Writing 10000000 entries to List took 2769
Writing to List PRO..
Writing 10000000 entries to List PRO took 2176
Writing to Linked List..
Writing 10000000 entries to Linked List took 33694
Locating 9000000 in Array..
Parsing Array took 6035
Locating 9000000 in List..
Parsing List took 6230
Locating 9000000 in List PRO..
Parsing List PRO took 0
Locating 9000000 in Linked List..
Parsing Linked List took 685
Done. Press Enter..

Here's the test code:
Code:
            long time = 0;
            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Reset();

            #region Initializing

            sw.Start();
            strArray = new String[n];
            time = sw.ElapsedMilliseconds;
            sw.Reset();
            outputStream.WriteLine("Array of " + n + " constructed in " + time);
            Console.WriteLine("Array of " + n + " constructed in " + time);

            sw.Start();      
            strList = new List<string>();
            time = sw.ElapsedMilliseconds;
            sw.Reset();
            outputStream.WriteLine("List constructed in " + time);
            Console.WriteLine("List constructed in " + time);

            sw.Start();      
            strListPro = new ListPro<string>();
            time = sw.ElapsedMilliseconds;
            sw.Reset();
            outputStream.WriteLine("List PRO constructed in " + time);
            Console.WriteLine("List PRO constructed in " + time);

            sw.Start();      
            strLinkedList = new LinkedList<string>();
            time = sw.ElapsedMilliseconds;
            sw.Reset();
            outputStream.WriteLine("Linked List constructed in " + time);
            Console.WriteLine("Linked List constructed in " + time);

            outputStream.WriteLine("Writing to Array..");
            Console.WriteLine("Writing to Array..");
            i = 0;
            sw.Start();
            while (i < n)
            {
                strArray[i] = i.ToString();
                i++;
            }
            time = sw.ElapsedMilliseconds;
            sw.Reset(); 
            outputStream.WriteLine("Writing " + n + " entries to Array took " + time);
            Console.WriteLine("Writing " + n + " entries to Array took " + time);
            

            outputStream.WriteLine("Writing to List..");
            Console.WriteLine("Writing to List..");
            i = 0;
            sw.Start();
            while (i < n)
            {
                strList.Add(i.ToString());
                i++;
            }
            time = sw.ElapsedMilliseconds;
            sw.Reset();
            outputStream.WriteLine("Writing " + n + " entries to List took " + time);
            Console.WriteLine("Writing " + n + " entries to List took " + time);

            outputStream.WriteLine("Writing to List PRO..");
            Console.WriteLine("Writing to List PRO..");
            i = 0;
            sw.Start();
             while (i < n)
            {
                strListPro.Add(i.ToString());
                i++;
            }
             time = sw.ElapsedMilliseconds;
             sw.Reset(); 
            outputStream.WriteLine("Writing " + n + " entries to List PRO took " + time);
            Console.WriteLine("Writing " + n + " entries to List PRO took " + time);

            outputStream.WriteLine("Writing to Linked List..");
            Console.WriteLine("Writing to Linked List..");
            i = 0;
            sw.Start();
            while (i < n)
            {
                strLinkedList.AddFirst(i.ToString());
                i++;
            }            
            time = sw.ElapsedMilliseconds;
            sw.Reset(); 
            outputStream.WriteLine("Writing " + n + " entries to Linked List took " + time);
            Console.WriteLine("Writing " + n + " entries to Linked List took " + time);

            outputStream.WriteLine("Locating " + 0.9 * n + " in Array..");
            Console.WriteLine("Locating " + 0.9 * n + " in Array..");
            sw.Start();
            foreach (string s in strArray)
            {
                if (s.Equals((0.9 * n).ToString()))
                {
                    break;
                }
            }
            time = sw.ElapsedMilliseconds;
            sw.Reset();
            outputStream.WriteLine("Parsing Array took " + time);
            Console.WriteLine("Parsing Array took " + time);

            outputStream.WriteLine("Locating " + 0.9 * n + " in List..");
            Console.WriteLine("Locating " + 0.9 * n + " in List..");
            sw.Start();
            foreach (string s in strList)
            {
                if (s.Equals((0.9 * n).ToString()))
                {
                    break;
                }
            }
            time = sw.ElapsedMilliseconds;
            sw.Reset();
            outputStream.WriteLine("Parsing List took " + time);
            Console.WriteLine("Parsing List took " + time);

            outputStream.WriteLine("Locating " + 0.9 * n + " in List PRO..");
            Console.WriteLine("Locating " + 0.9 * n + " in List PRO..");
            sw.Start();
            strListPro.IndexOf((0.9 * n).ToString());
            time = sw.ElapsedMilliseconds;
            sw.Reset();
            outputStream.WriteLine("Parsing List PRO took " + time);
            Console.WriteLine("Parsing List PRO took " + time);


            outputStream.WriteLine("Locating " + 0.9 * n + " in Linked List..");
            Console.WriteLine("Locating " + 0.9 * n + " in Linked List..");
            sw.Start();
            foreach (string s in strLinkedList)
            {
                if (s.Equals((0.9 * n).ToString()))
                {
                    break;
                }
            }            
            time = sw.ElapsedMilliseconds;
            sw.Reset();
            outputStream.WriteLine("Parsing Linked List took " + time);
            Console.WriteLine("Parsing Linked List took " + time);
My Rig
(14 items)
 
Ex-wife's Rig
(15 items)
 
 
CPUMotherboardGraphicsRAM
Core i5 4460 AsRock H81M-DG4 Sapphire Rx470 Platinum KVR 1600 16Gb 
Hard DriveHard DriveCoolingOS
2x Seagate 3Tb Samsung 850 EVO 120 Scythe Ninja 3 Rev.B Windows 10 Pro 
MonitorKeyboardPowerCase
Fujitsu Siemens A17-2A Logitech K280e SuperFlower SF-550K12XP Thermaltake Versa H25 
MouseAudio
Logitech G402 Sony MDR XD150 
CPUMotherboardGraphicsRAM
Athlon 750K 4.0Ghz AsRock FM2A75 Pro4+ Sapphire R9 270X Dual-X Kingston 2x4Gb 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 850 EVO 120  Western Digital 320Gb LiteON DVD-RW CoolerMaster Hyper Z600 
OSMonitorKeyboardPower
Windows 7 Pro x64 Toshiba 32" FullHD TV Logitech FSP Hexa 550 
CaseMouse
DeLUX Logitech 
  hide details  
Reply
My Rig
(14 items)
 
Ex-wife's Rig
(15 items)
 
 
CPUMotherboardGraphicsRAM
Core i5 4460 AsRock H81M-DG4 Sapphire Rx470 Platinum KVR 1600 16Gb 
Hard DriveHard DriveCoolingOS
2x Seagate 3Tb Samsung 850 EVO 120 Scythe Ninja 3 Rev.B Windows 10 Pro 
MonitorKeyboardPowerCase
Fujitsu Siemens A17-2A Logitech K280e SuperFlower SF-550K12XP Thermaltake Versa H25 
MouseAudio
Logitech G402 Sony MDR XD150 
CPUMotherboardGraphicsRAM
Athlon 750K 4.0Ghz AsRock FM2A75 Pro4+ Sapphire R9 270X Dual-X Kingston 2x4Gb 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 850 EVO 120  Western Digital 320Gb LiteON DVD-RW CoolerMaster Hyper Z600 
OSMonitorKeyboardPower
Windows 7 Pro x64 Toshiba 32" FullHD TV Logitech FSP Hexa 550 
CaseMouse
DeLUX Logitech 
  hide details  
Reply
post #13 of 31
Wait wait wait....

All of your "search" methods are just walking the entire structure. Use the functions specifically designed for searching!

http://stackoverflow.com/questions/6...all-vs-foreach
    
CPUMotherboardGraphicsRAM
Intel Core i7 920 @ 4Ghz Rampage II GENE PNY GTX 680 G.Skill Sniper (12GB) 
Hard DriveOptical DriveCoolingOS
Seagate Momentus XT SATA Optical Drive Kuhler 920 Windows 7 Ultimate 
MonitorKeyboardPowerCase
Dell U2410 Logitech G11  Silverstone ST75 750W Antec Mini P180B 
MouseMouse PadOther
Logitech MX518 Steelpad G19 Gaming Headset 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Intel Core i7 920 @ 4Ghz Rampage II GENE PNY GTX 680 G.Skill Sniper (12GB) 
Hard DriveOptical DriveCoolingOS
Seagate Momentus XT SATA Optical Drive Kuhler 920 Windows 7 Ultimate 
MonitorKeyboardPowerCase
Dell U2410 Logitech G11  Silverstone ST75 750W Antec Mini P180B 
MouseMouse PadOther
Logitech MX518 Steelpad G19 Gaming Headset 
  hide details  
Reply
post #14 of 31
Thread Starter 
Quote:
Originally Posted by killnine View Post
Wait wait wait....

All of your "search" methods are just walking the entire structure. Use the functions specifically designed for searching!

http://stackoverflow.com/questions/6...all-vs-foreach
Hm. Ok, will do
However, SortedDict doesn't have FindAll() function, the fastest possible there is the BinarySearch, whcih is still 110ms to 0 (for 1M values).

About the List.. can FindAll() be faster than 0ms? We'll see Implementing now...
My Rig
(14 items)
 
Ex-wife's Rig
(15 items)
 
 
CPUMotherboardGraphicsRAM
Core i5 4460 AsRock H81M-DG4 Sapphire Rx470 Platinum KVR 1600 16Gb 
Hard DriveHard DriveCoolingOS
2x Seagate 3Tb Samsung 850 EVO 120 Scythe Ninja 3 Rev.B Windows 10 Pro 
MonitorKeyboardPowerCase
Fujitsu Siemens A17-2A Logitech K280e SuperFlower SF-550K12XP Thermaltake Versa H25 
MouseAudio
Logitech G402 Sony MDR XD150 
CPUMotherboardGraphicsRAM
Athlon 750K 4.0Ghz AsRock FM2A75 Pro4+ Sapphire R9 270X Dual-X Kingston 2x4Gb 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 850 EVO 120  Western Digital 320Gb LiteON DVD-RW CoolerMaster Hyper Z600 
OSMonitorKeyboardPower
Windows 7 Pro x64 Toshiba 32" FullHD TV Logitech FSP Hexa 550 
CaseMouse
DeLUX Logitech 
  hide details  
Reply
My Rig
(14 items)
 
Ex-wife's Rig
(15 items)
 
 
CPUMotherboardGraphicsRAM
Core i5 4460 AsRock H81M-DG4 Sapphire Rx470 Platinum KVR 1600 16Gb 
Hard DriveHard DriveCoolingOS
2x Seagate 3Tb Samsung 850 EVO 120 Scythe Ninja 3 Rev.B Windows 10 Pro 
MonitorKeyboardPowerCase
Fujitsu Siemens A17-2A Logitech K280e SuperFlower SF-550K12XP Thermaltake Versa H25 
MouseAudio
Logitech G402 Sony MDR XD150 
CPUMotherboardGraphicsRAM
Athlon 750K 4.0Ghz AsRock FM2A75 Pro4+ Sapphire R9 270X Dual-X Kingston 2x4Gb 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 850 EVO 120  Western Digital 320Gb LiteON DVD-RW CoolerMaster Hyper Z600 
OSMonitorKeyboardPower
Windows 7 Pro x64 Toshiba 32" FullHD TV Logitech FSP Hexa 550 
CaseMouse
DeLUX Logitech 
  hide details  
Reply
post #15 of 31
Thread Starter 
Quote:
Originally Posted by killnine View Post
Wait wait wait....

All of your "search" methods are just walking the entire structure. Use the functions specifically designed for searching!

http://stackoverflow.com/questions/6...all-vs-foreach
Yes, List is way faster using the FindIndex(), however still not fast enough.

Inserts 1M Strings in 200ms, finds "900000" in 660ms.
Mine inserts *and sorts* 1M Strings in 210ms and finds "900000" in 0.

In the SortedDict vs SDH area the results are the same.

EDIT:

Here's the last log too (i changed the layout a bit for better grouping):

STRING TEST /0

Array of 1000000 constructed in 0
List constructed in 0
List PRO constructed in 0
Linked List constructed in 0
Dictionary constructed in 0
Sorted Dictionary constructed in 0
DataHub constructed in 0
Multiple DataHub constructed in 0

Writing to Array..
Writing 1000000 entries to Array took 179
Locating 900000 in Array..
Parsing Array took 605

Writing to List..
Writing 1000000 entries to List took 201
Locating 900000 in List..
Parsing List took 639

Writing to List PRO..
Writing 1000000 entries to List PRO took 209
Locating 900000 in List PRO..
Parsing List PRO took 1

Writing to Linked List..
Writing 1000000 entries to Linked List took 453
Locating 900000 in Linked List..
Parsing Linked List took 2

Writing to Dictionary..
Writing 1000000 key/value pairs to Dictionary took 552
Locating 900000 in Dictionary..
Parsing Dictionary took 3109

Writing to Sorted Dictionary..
Writing 1000000 key/value pairs to Sorted Dictionary took 5285
Locating 900000 in Sorted Dictionary..
Parsing Sorted Dictionary took 902
Locating 900000 in Sorted Dictionary (Binary Search)..
Parsing Sorted Dictionary (Binary Search) took 107

Writing to DataHub..
Writing 1000000 key/value pairs to DataHub took 479
Locating 900000 in DataHub (Binary Search)..
Parsing DataHub (Binary Search) took 1

Writing to Multiple DataHub..
Writing 1000000 x4 key/value pairs to Multiple DataHub took 7057

Done. Press Enter..
Edited by ronnin426850 - 3/30/11 at 8:25am
My Rig
(14 items)
 
Ex-wife's Rig
(15 items)
 
 
CPUMotherboardGraphicsRAM
Core i5 4460 AsRock H81M-DG4 Sapphire Rx470 Platinum KVR 1600 16Gb 
Hard DriveHard DriveCoolingOS
2x Seagate 3Tb Samsung 850 EVO 120 Scythe Ninja 3 Rev.B Windows 10 Pro 
MonitorKeyboardPowerCase
Fujitsu Siemens A17-2A Logitech K280e SuperFlower SF-550K12XP Thermaltake Versa H25 
MouseAudio
Logitech G402 Sony MDR XD150 
CPUMotherboardGraphicsRAM
Athlon 750K 4.0Ghz AsRock FM2A75 Pro4+ Sapphire R9 270X Dual-X Kingston 2x4Gb 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 850 EVO 120  Western Digital 320Gb LiteON DVD-RW CoolerMaster Hyper Z600 
OSMonitorKeyboardPower
Windows 7 Pro x64 Toshiba 32" FullHD TV Logitech FSP Hexa 550 
CaseMouse
DeLUX Logitech 
  hide details  
Reply
My Rig
(14 items)
 
Ex-wife's Rig
(15 items)
 
 
CPUMotherboardGraphicsRAM
Core i5 4460 AsRock H81M-DG4 Sapphire Rx470 Platinum KVR 1600 16Gb 
Hard DriveHard DriveCoolingOS
2x Seagate 3Tb Samsung 850 EVO 120 Scythe Ninja 3 Rev.B Windows 10 Pro 
MonitorKeyboardPowerCase
Fujitsu Siemens A17-2A Logitech K280e SuperFlower SF-550K12XP Thermaltake Versa H25 
MouseAudio
Logitech G402 Sony MDR XD150 
CPUMotherboardGraphicsRAM
Athlon 750K 4.0Ghz AsRock FM2A75 Pro4+ Sapphire R9 270X Dual-X Kingston 2x4Gb 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 850 EVO 120  Western Digital 320Gb LiteON DVD-RW CoolerMaster Hyper Z600 
OSMonitorKeyboardPower
Windows 7 Pro x64 Toshiba 32" FullHD TV Logitech FSP Hexa 550 
CaseMouse
DeLUX Logitech 
  hide details  
Reply
post #16 of 31
Thread Starter 
And sorry for the tripple-post Here are the results with 10M, where List<T> fails again, even though Find was properly used:

STRING TEST /0
Array of 10000000 constructed in 0
List constructed in 0
List PRO constructed in 0
Linked List constructed in 0
Dictionary constructed in 0
Sorted Dictionary constructed in 0
DataHub constructed in 0
Multiple DataHub constructed in 0

Writing to Array..
Writing 10000000 entries to Array took 2258
Locating 9000000 in Array..
Parsing Array took 6131

Writing to List..
Writing 10000000 entries to List took 2558
Locating 9000000 in List..
Parsing List took 6146

Writing to List PRO..
Writing 10000000 entries to List PRO took 2177
Locating 9000000 in List PRO..
Parsing List PRO took 1

Writing to Linked List..
Writing 10000000 entries to Linked List took 33871
Locating 9000000 in Linked List..
Parsing Linked List took 21

Done. Press Enter..
My Rig
(14 items)
 
Ex-wife's Rig
(15 items)
 
 
CPUMotherboardGraphicsRAM
Core i5 4460 AsRock H81M-DG4 Sapphire Rx470 Platinum KVR 1600 16Gb 
Hard DriveHard DriveCoolingOS
2x Seagate 3Tb Samsung 850 EVO 120 Scythe Ninja 3 Rev.B Windows 10 Pro 
MonitorKeyboardPowerCase
Fujitsu Siemens A17-2A Logitech K280e SuperFlower SF-550K12XP Thermaltake Versa H25 
MouseAudio
Logitech G402 Sony MDR XD150 
CPUMotherboardGraphicsRAM
Athlon 750K 4.0Ghz AsRock FM2A75 Pro4+ Sapphire R9 270X Dual-X Kingston 2x4Gb 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 850 EVO 120  Western Digital 320Gb LiteON DVD-RW CoolerMaster Hyper Z600 
OSMonitorKeyboardPower
Windows 7 Pro x64 Toshiba 32" FullHD TV Logitech FSP Hexa 550 
CaseMouse
DeLUX Logitech 
  hide details  
Reply
My Rig
(14 items)
 
Ex-wife's Rig
(15 items)
 
 
CPUMotherboardGraphicsRAM
Core i5 4460 AsRock H81M-DG4 Sapphire Rx470 Platinum KVR 1600 16Gb 
Hard DriveHard DriveCoolingOS
2x Seagate 3Tb Samsung 850 EVO 120 Scythe Ninja 3 Rev.B Windows 10 Pro 
MonitorKeyboardPowerCase
Fujitsu Siemens A17-2A Logitech K280e SuperFlower SF-550K12XP Thermaltake Versa H25 
MouseAudio
Logitech G402 Sony MDR XD150 
CPUMotherboardGraphicsRAM
Athlon 750K 4.0Ghz AsRock FM2A75 Pro4+ Sapphire R9 270X Dual-X Kingston 2x4Gb 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 850 EVO 120  Western Digital 320Gb LiteON DVD-RW CoolerMaster Hyper Z600 
OSMonitorKeyboardPower
Windows 7 Pro x64 Toshiba 32" FullHD TV Logitech FSP Hexa 550 
CaseMouse
DeLUX Logitech 
  hide details  
Reply
post #17 of 31
Thread Starter 
I have engaged in more deep tests and optimizations. I'm getting very interesting variation in results between 2 scenarios - where you have some app logic between insert and Find(), and where you don't have such.
I'll compile a new comparisson and update soon
My Rig
(14 items)
 
Ex-wife's Rig
(15 items)
 
 
CPUMotherboardGraphicsRAM
Core i5 4460 AsRock H81M-DG4 Sapphire Rx470 Platinum KVR 1600 16Gb 
Hard DriveHard DriveCoolingOS
2x Seagate 3Tb Samsung 850 EVO 120 Scythe Ninja 3 Rev.B Windows 10 Pro 
MonitorKeyboardPowerCase
Fujitsu Siemens A17-2A Logitech K280e SuperFlower SF-550K12XP Thermaltake Versa H25 
MouseAudio
Logitech G402 Sony MDR XD150 
CPUMotherboardGraphicsRAM
Athlon 750K 4.0Ghz AsRock FM2A75 Pro4+ Sapphire R9 270X Dual-X Kingston 2x4Gb 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 850 EVO 120  Western Digital 320Gb LiteON DVD-RW CoolerMaster Hyper Z600 
OSMonitorKeyboardPower
Windows 7 Pro x64 Toshiba 32" FullHD TV Logitech FSP Hexa 550 
CaseMouse
DeLUX Logitech 
  hide details  
Reply
My Rig
(14 items)
 
Ex-wife's Rig
(15 items)
 
 
CPUMotherboardGraphicsRAM
Core i5 4460 AsRock H81M-DG4 Sapphire Rx470 Platinum KVR 1600 16Gb 
Hard DriveHard DriveCoolingOS
2x Seagate 3Tb Samsung 850 EVO 120 Scythe Ninja 3 Rev.B Windows 10 Pro 
MonitorKeyboardPowerCase
Fujitsu Siemens A17-2A Logitech K280e SuperFlower SF-550K12XP Thermaltake Versa H25 
MouseAudio
Logitech G402 Sony MDR XD150 
CPUMotherboardGraphicsRAM
Athlon 750K 4.0Ghz AsRock FM2A75 Pro4+ Sapphire R9 270X Dual-X Kingston 2x4Gb 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 850 EVO 120  Western Digital 320Gb LiteON DVD-RW CoolerMaster Hyper Z600 
OSMonitorKeyboardPower
Windows 7 Pro x64 Toshiba 32" FullHD TV Logitech FSP Hexa 550 
CaseMouse
DeLUX Logitech 
  hide details  
Reply
post #18 of 31
Few realistic scenarios you should test:

Random insert order (you'll likely need to keep a separate array in memory)

Reverse insert order

Search for all values (in order, random order (not same as insert order), reverse order) - time it all for this because one search is hardly representative

Insert/Search/Remove interlaced with random ordering (you can search for values that may have been removed, since that's a use case, use try-get for dictionary if you do). This one is trickier, and is really a test on the collection's properties.

Incidentally, for "Random" make sure that the random is the same for all container types, might be worth creating a file for the tests (read in the file to memory before running any tests).

Also, you should keep track of memory in these tests, generally an array will be much more memory efficient, but a binary tree will be much faster to search. The important part of the structure is actually choosing the correct one for the job.
Micro Dance
(8 items)
 
  
CPUMotherboardGraphicsRAM
i7-4790k z97i-plus EVGA GTX980 SC 16GB Team Xtreme 2400 
Hard DriveCoolingOSCase
512GB Samsung SSD 830 NH-L12 Windows 10 EVGA Hadron Air 
  hide details  
Reply
Micro Dance
(8 items)
 
  
CPUMotherboardGraphicsRAM
i7-4790k z97i-plus EVGA GTX980 SC 16GB Team Xtreme 2400 
Hard DriveCoolingOSCase
512GB Samsung SSD 830 NH-L12 Windows 10 EVGA Hadron Air 
  hide details  
Reply
post #19 of 31
Thread Starter 
Quote:
Originally Posted by Xeio View Post
Few realistic scenarios you should test:

Random insert order (you'll likely need to keep a separate array in memory)

Reverse insert order

Search for all values (in order, random order (not same as insert order), reverse order) - time it all for this because one search is hardly representative

Insert/Search/Remove interlaced with random ordering (you can search for values that may have been removed, since that's a use case, use try-get for dictionary if you do). This one is trickier, and is really a test on the collection's properties.

Incidentally, for "Random" make sure that the random is the same for all container types, might be worth creating a file for the tests (read in the file to memory before running any tests).

Also, you should keep track of memory in these tests, generally an array will be much more memory efficient, but a binary tree will be much faster to search. The important part of the structure is actually choosing the correct one for the job.
Thanks for the tips!

The insertion now is sort of "random", unsorted, because I insert "1, 2, 3... etc", but those are Strings and they sort as "1, 11, 111, 2, 22, 222, 3, 33.. etc".

I'll do all the suggested things How do I check for memory use? Other than TaskManager, of course..?
My Rig
(14 items)
 
Ex-wife's Rig
(15 items)
 
 
CPUMotherboardGraphicsRAM
Core i5 4460 AsRock H81M-DG4 Sapphire Rx470 Platinum KVR 1600 16Gb 
Hard DriveHard DriveCoolingOS
2x Seagate 3Tb Samsung 850 EVO 120 Scythe Ninja 3 Rev.B Windows 10 Pro 
MonitorKeyboardPowerCase
Fujitsu Siemens A17-2A Logitech K280e SuperFlower SF-550K12XP Thermaltake Versa H25 
MouseAudio
Logitech G402 Sony MDR XD150 
CPUMotherboardGraphicsRAM
Athlon 750K 4.0Ghz AsRock FM2A75 Pro4+ Sapphire R9 270X Dual-X Kingston 2x4Gb 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 850 EVO 120  Western Digital 320Gb LiteON DVD-RW CoolerMaster Hyper Z600 
OSMonitorKeyboardPower
Windows 7 Pro x64 Toshiba 32" FullHD TV Logitech FSP Hexa 550 
CaseMouse
DeLUX Logitech 
  hide details  
Reply
My Rig
(14 items)
 
Ex-wife's Rig
(15 items)
 
 
CPUMotherboardGraphicsRAM
Core i5 4460 AsRock H81M-DG4 Sapphire Rx470 Platinum KVR 1600 16Gb 
Hard DriveHard DriveCoolingOS
2x Seagate 3Tb Samsung 850 EVO 120 Scythe Ninja 3 Rev.B Windows 10 Pro 
MonitorKeyboardPowerCase
Fujitsu Siemens A17-2A Logitech K280e SuperFlower SF-550K12XP Thermaltake Versa H25 
MouseAudio
Logitech G402 Sony MDR XD150 
CPUMotherboardGraphicsRAM
Athlon 750K 4.0Ghz AsRock FM2A75 Pro4+ Sapphire R9 270X Dual-X Kingston 2x4Gb 1600 
Hard DriveHard DriveOptical DriveCooling
Samsung 850 EVO 120  Western Digital 320Gb LiteON DVD-RW CoolerMaster Hyper Z600 
OSMonitorKeyboardPower
Windows 7 Pro x64 Toshiba 32" FullHD TV Logitech FSP Hexa 550 
CaseMouse
DeLUX Logitech 
  hide details  
Reply
post #20 of 31
Quote:
Originally Posted by ronnin426850 View Post
I'll do all the suggested things How do I check for memory use? Other than TaskManager, of course..?
Well, other than pausing to run a memory profiler and such, you could use System.Diagnostics.Process.GetCurrentProccess() and use the memory variables of that class. I'm not entirely sure which one you'd want though, I think working set (sometime after the collection is full) is the one you'd want. Peak working set could work, though you'd have to spawn each test on a separate process if you'd want to use that.
Micro Dance
(8 items)
 
  
CPUMotherboardGraphicsRAM
i7-4790k z97i-plus EVGA GTX980 SC 16GB Team Xtreme 2400 
Hard DriveCoolingOSCase
512GB Samsung SSD 830 NH-L12 Windows 10 EVGA Hadron Air 
  hide details  
Reply
Micro Dance
(8 items)
 
  
CPUMotherboardGraphicsRAM
i7-4790k z97i-plus EVGA GTX980 SC 16GB Team Xtreme 2400 
Hard DriveCoolingOSCase
512GB Samsung SSD 830 NH-L12 Windows 10 EVGA Hadron Air 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › [Benchmark] .NET4 vs Hand-made collections