More timing, different types of tests
Yesterday I blog'ged about some various string splitting times. One thing which amazed me was how slow the VB Split Function was:
========== DoFunction() ========== Entering DoFunction()... DoFunction() took 4947.1136 milliseconds. Entering DoFunction()... DoFunction() took 4927.0848 milliseconds. Entering DoFunction()... DoFunction() took 4927.0848 milliseconds. ========== DoMethod() ========== Entering DoMethod()... DoMethod() took 50.072 milliseconds. Entering DoMethod()... DoMethod() took 40.0576 milliseconds. Entering DoMethod()... DoMethod() took 60.0864 milliseconds.
Today, I changed the tests so that the initial string was much smaller (900 chars versus 900,000) and ran the split operations within loops (as opposed to one big, single Split operation) of 1000 loops. This was done so that if there was any Garbage collection noise in the VB Split FUnction it might be removed from the overall result. The results amazed me somewhat:
========== DoFunction() ========== Entering DoFunction()... DoFunction() took 30.0432 milliseconds. Entering DoFunction()... DoFunction() took 20.0288 milliseconds. Entering DoFunction()... DoFunction() took 30.0432 milliseconds. ========== DoMethod() ========== Entering DoMethod()... DoMethod() took 50.072 milliseconds. Entering DoMethod()... DoMethod() took 40.0576 milliseconds. Entering DoMethod()... DoMethod() took 40.0576 milliseconds.
Related Reading
Timing Your Code