7 ms·
I have updated the test with the new figures that I got. Initially I only tested with Python 2 with math.pow. I have to say I am quite disappointed with the per
by bite_victim 11y ago
I have updated the test with the new figures that I got. Initially I only tested with Python 2 with math.pow. I have to say I am quite disappointed with the performance of Python 3 though and even using the built-in pow function, PHP 5.6 still is the fastest in this particular case.
- maxerickson 11y agoThe call to int is unnecessary when using the built in.
- deleted 11y ago[deleted]
- bite_victim 11y agoI am a clumsy individual. Dropping the int call resulted in shaving 3.5 seconds. But how is this possible?! It's ridiculous, really!
- maxerickson 11y agoThe CPython interpreter is pretty naive, so it more or less does what you tell it to.
- bite_victim 11y agoPHP is no better, if you add an intval call it will add almost 4 seconds to the result! This is an extraordinary proof that being a little sloppy can cost you a lot when using interpreted scripting languages! Also, I am thinking if and how much speed gain could one inject by not using OOP in PHP...