4 ms·
Thanks for your feedback. (Author here.) By my calculations (which I'll machine-check now with Maxima), the 30% and 70% speed-up claims are sound. First, let'
by tmoertel 13y ago
Thanks for your feedback. (Author here.)
By my calculations (which I'll machine-check now with Maxima), the 30% and 70% speed-up claims are sound. First, let's fire up Maxima:
$ maxima
Maxima 5.30.0 http://maxima.sourceforge.net
using Lisp SBCL 1.1.8-2.fc19
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
Now let's calculate how much faster we made the row-copy code by unrolling its loop:
(%i1) orig_loop_speed: (1*row) / (157*cycle)$
(%i2) unrolled_loop_speed: (1*row) / (120*cycle)$
(%i3) unrolling_speedup: unrolled_loop_speed / orig_loop_speed, numer;
(%o3) 1.308333333333333
In other words, the unrolled-loop speed is 1.3 times the original-loop speed. That's 30% faster, right?
Likewise, how much faster did shaving those 1200 cycles make the tile-copy code?
(%i4) copy2_speed: (1*tile) / (2893*cycle)$
(%i5) copy3_speed: (1*tile) / (1689*cycle)$
(%i6) copy3_vs_2_speedup: copy3_speed / copy2_speed, numer;
(%o6) 1.712847838957963
I'm willing to believe that I've screwed up here, but I can't see where. Can you show me?
Thanks for your help!
- kilburn 13y agoYour only "mistake" was to switch to a different measure when giving the percentages. Your calculations are actually fine, because you explicitly label them "speedup". However, this can confuse a non-thorough reader because your previous measures are not about "speed"; they are about "cost" (cycles). The parent just did not realize the switch, and thought that you were claiming to have reduced "cost" (cycles) by 30%/70%, which wouldn't be true.
- tmoertel 13y agoThanks for this insight! I never would have seen it had you not told me. (I'm an engineering guy and switching between time-per-unit and units-per-time is so automatic for me that I didn't realize it wasn't automatic for everybody.) I've updated the story to explain the calculation the first time it happens. Thanks again!
- oofabz 13y agoAs a fellow Maxima user, thanks for showing me "expr, numer". I've always used "float(expr)" for that, but I like yours better.