The main lines in the code that I was testing are the following:
... string fileName = d + dirSeparator + info.Name; //dirSeparator is defined once at the beginning of the method. ... string fileName = d + "/" + info.Name; ... string fileName = d + Path.DirectorySeparatorChar + info.Name; ... string fileName = Path.Combine(d, info.Name); ...
And the results:
bperry@bperry-desktop:~/Projects/PathingSpeedTest/PathingSpeedTest/bin/Release$ mono PathingSpeedTest.exe Building cache... Starting escape from outside iterations... Took 23 seconds Most RAM: 78932kb (Started with 78800kb) Most GC: 620kb (Started with 604kb) Starting escape from inside iterations... Took 29 seconds Most RAM: 78828kb (Started with 78828kb) Most GC: 616kb (Started with 612kb) Starting environment escape... Took 29 seconds Most RAM: 78828kb (Started with 78828kb) Most GC: 632kb (Started with 600kb) Starting Path.Combine() test... Took 29 seconds Most RAM: 78828kb (Started with 78828kb) Most GC: 616kb (Started with 612kb) bperry@bperry-desktop:~/Projects/PathingSpeedTest/PathingSpeedTest/bin/Release$
May not be the best way to test this, so I am open to suggestions. Source code is here (is monodevelop, so not sure if it will open in VS).