top | item 43089822

(no title)

bean-weevil | 1 year ago

Why not just compile that particular object with optimizations on and the rest of the file with optimizations off?

discuss

order

broken_broken_|1 year ago

Yes, that's the obvious (and boring!) answer, that I mention in the introduction and that's in a way the implicit conclusion. But that does not teach us SIMD then :)

saurik|1 year ago

Your article isn't really about, though, how to speed up a debug build, and I thereby think you're likely not going to find the right audience. Like, to be honest, I gave up on your article, because while I found the premise of speeding up a debug build really interesting, I (currently) have no interest in hand-optimizing SIMD... but, in another time, or if I were someone else, I might find that really interesting, but then would not have thought to look at this article. "Hand-optimizing SHA-1 using SIMD intrinsics and assembly" is just a very different mental space than "making my debug build run 100x faster", even if they are two ways to describe the same activity. "Using SIMD and assembly to avoid relying on compiler optimizations for performance" also feels better? I would at least get it if your title was a pun or a joke or was in some way fun--at which point I would blame Hacker News for pulling articles out of their context and not having a good policy surrounding publicly facing titles or subtitles--but it feels like, in this case, the title is merely a poor way to describe the content.

mperham|1 year ago

Yep, I was hoping to learn how to do this. Seems like a much better long term lesson.

senkora|1 year ago

For gcc: #pragma GCC optimize ("O0")

For clang: #pragma clang optimize off

For MSVC: #pragma optimize("", off)

Put one of these at the top of your source file.