nolanlawson / optimize-js

Optimize a JS file for faster parsing (UNMAINTAINED)
https://nolanlawson.github.io/optimize-js
Apache License 2.0
3.75k stars 104 forks source link

Your math is wrong #13

Closed BlueRaja closed 8 years ago

BlueRaja commented 8 years ago

You list 9.42ms --> 5.27ms as a 128.73% improvement, but list 12.76ms --> 1.75ms as an 86.29% improvement!?

The actual correct percentages are "78.75% and 629.14% increases in speed (respectively)", or equivalently, "44.06% and 86.29% decrease in runtime".

The formulas are: Increase in speed: old/new - 1 Decrease in runtime: 1 - new/old

nolanlawson commented 8 years ago

Fixed in https://github.com/nolanlawson/optimize-js/pull/14 ; the improvement numbers were indeed miscalculated by a bit. Thanks for reporting!