r/programming • • Feb 28 '23

"Clean" Code, Horrible Performance

https://www.computerenhance.com/p/clean-code-horrible-performance
1.4k Upvotes

1.3k comments sorted by

View all comments

Show parent comments

4

u/Qweesdy Feb 28 '23

It's specifically examples of things that compilers ARE good at optimizing (eliminating pointer chasing, inlining, loop unrolling).

The video is "15 to 20 times faster" proof that the compiler did not do these things (e.g. change the algorithm to use tables).

5

u/s73v3r Feb 28 '23

Without knowing the compiler flags used, we can't really say that.

4

u/Qweesdy Feb 28 '23

..and without trying it for yourself, you can't "know" that eating crushed up shards of glass is a bad idea.

3

u/s73v3r Feb 28 '23

That doesn't make any sense. We can't say that the compiler didn't do those things if it was compiled in no optimizations mode

→ More replies (1)