Subject: | ulp() speed improvement |
I was reminded v0.012 still uses ULP = $val - toggle_ulp($val), which seems an inefficient way of doing it. Since BrowserUK was wanting the ulp() functionality in something where speed matters, I ran some benchmarks using https://subversion.assembla.com/svn/pryrt/trunk/perl/benchULP.pl:
cmpthese(-60):
Rate orig bysub bydiv
orig 7596/s -- -31% -39%
bysub 10935/s 44% -- -12%
bydiv 12376/s 63% 13% --
cmpthese(1000000):
Rate orig bysub bydiv
orig 8273/s -- -22% -33%
bysub 10595/s 28% -- -14%
bydiv 12372/s 50% 17% --
Thus, want to replace existing ulp() with ulp_by_div()!