3 ms·
The question was more interesting than the answer. tl;dr version--the author's hand-written assembly was poor. I guess the more interesting takeaway is "Just
by AdmiralAsshat 9y ago
The question was more interesting than the answer.
tl;dr version--the author's hand-written assembly was poor.
I guess the more interesting takeaway is "Just because it's assembly doesn't mean it's good assembly."
- bluedino 9y agoRight - you have to have a bit of hardware knowledge to use it effectively
- pdpi 9y agoThat takeaway is more or less uniformly true, though. It also often comes up as saying that $LANGUAGE is slower than C or C++. Your algorithms aren't naturally faster just because you're writing in C++. You don't magically stop allocating and double-buffering all over the place just because you're writing C++. In fact, coming in from the likes of Java you're liable to underestimate just how much (relatively expensive) copying is going on if you're careless. What C and C++ give you (and Assembly gives you even more of) is control. If you can, and know how to, capitalise on that control, you _will_ get more performance. But those requirements are non-trivial.