4 ms·
Are you serious? Of course you can. Some hash algorithms are slower than others, you can read that and know that. Allocating in a hot loop is probably slower th
by insanitybit 2mo ago
Are you serious? Of course you can. Some hash algorithms are slower than others, you can read that and know that. Allocating in a hot loop is probably slower than allocating outside of it. Duh? I can't believe this even has to be justified, of course you can look at code and get an idea of its performance properties lol
Obviously you want empirical evidence to justify changes, but like... duh, you can read code and understand how it executes.
- inigyou 2mo agoSometimes when you look at code you know is slow, you can immediately see why it's slow. Obviously you didn't see it when you wrote it, which disproves your hypothesis.
- insanitybit 2mo agoWhat? Sorry, I genuinely have no idea what you're talking about. Is it possible to look at code and intuit, just by reading, how to speed it up? Duh, yes. If you disagree, lol. Keep in mind that I've never stated that all performance issues are findable through code review. Just that there are many that are. > You can very easily spot performance issues through code. If you think that this is false, there's literally nothing you can contribute.
- inigyou 2mo agoDemonstrate for me, then. Here's some slow code: https://github.com/torvalds/linux https://github.com/torvalds/linux Speed it up.
- insanitybit 2mo agoI can't take this seriously. The claim "you can look at SOME code and see how to optimize it" is trivially true, and saying "you can't look at ALL code and see how to optimize it" changes nothing.
- inigyou 2mo agoExactly, you have to find the slow code first, with profiling, and then sometimes it is obvious why that code is slow. It is unlikely you can just look at a project and find the slow code in it.
- insanitybit 2mo agoYou absolutely can. I've given enough examples that are obviously true. If you can't read code and reason about its performance, that is a personal issue.