Hacker News new | ask | show | jobs
by JackYoustra 783 days ago
I've previously had problems with the compiler not inlining / eliding instructions solely due to profiling code (see a blog post: https://www.jackyoustra.com/blog/llama-ios#-bug-bug-slowdown...). I wonder if it's that?

(I've also always had a sneaking suspicion I did something wrong in my example, so if anyone knows let me know)

1 comments

Pcwalton’s explanation is much more likely to be correct https://news.ycombinator.com/context?id=41830704

Profiling native code with optimizations on is very very tricky.

What's the point of profiling for performance without optimizations if it leads you where the OP winds up hand rolling the same transformations?
Usually a terrible idea (imo) to profile without optimizations, I think the point is profiling with optimizations is tricky (without much better alternative).
Agree, seems like a more likely culprit in this case.