3 ms·
What nonsense is this. Someone did a big unnecessary big memcpy in a loop and you removed it and see 3x faster, how is this breaking the code?
by up2isomorphism 3y ago
What nonsense is this. Someone did a big unnecessary big memcpy in a loop and you removed it and see 3x faster, how is this breaking the code?
- repelsteeltje 3y agoThe point of Matt Godbalt's "law" is that eventually you'll discover that the undocumented, mysterious memcpy wasn't unnecessary. Ie. It was a hacky resolution for a weird race condition edge case that couldn't be solved some other way without introducing some other, major regression. Off course, he doesn't mean to say you can never optimize to gain speed increases of > 2x. It's a hyperbole, build on his experience working with well written optimized time-critical software (think games, high volume/low latency trading), where on a good day you're happy to improve performance by 3%.