Yea I noticed that and wanted more insight, so I dug into it more.
It would appear the execution speed is affected by the order/definition.
I saw improvements when flipping the order of execution where the "faster" method goes second, rather than first and the execution ends up faster. I'm not really sure why this is.
I also removed the slower/faster pieces of code so the code only focuses on only 1 implementation and got similar behavior where the faster version does go faster, but only a little.
So end all, yes the "faster" optimization is an optimization. But even then you're only looking at slightly faster execution speeds in the realm of .05 of a second improvements for 10 million elements. (at least on my machine)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
That's why I wrote, if it's faster at all...
Yea I noticed that and wanted more insight, so I dug into it more.
It would appear the execution speed is affected by the order/definition.
I saw improvements when flipping the order of execution where the "faster" method goes second, rather than first and the execution ends up faster. I'm not really sure why this is.
I also removed the slower/faster pieces of code so the code only focuses on only 1 implementation and got similar behavior where the faster version does go faster, but only a little.
So end all, yes the "faster" optimization is an optimization. But even then you're only looking at slightly faster execution speeds in the realm of
.05
of a second improvements for 10 million elements. (at least on my machine)