3 ms·
I find that the code that looks slow often isn't, and the really slow code is always a surprise. I work on something that uses a lot of immutables with copy-mo
by gwbas1c 8y ago
I find that the code that looks slow often isn't, and the really slow code is always a surprise.
I work on something that uses a lot of immutables with copy-modify operations. They never show up in a profiler as a hot spot. The most surprising hot spot was a default logger configuration setting that we didn't need. Other hot spots were file API calls that we didn't know we're slow.
I think what's more important is to use common sense in the beginning, and optimize for your budget. Meaning: Know how to use your libraries / apis, don't pick stupid patterns, and only do as much optimization as you have time for.
Sometimes an extra sever or shard is cheaper than an extra programmer, or gets you to market on time. Sometimes no one will notice that your operation takes an extra 20ms. Those are tradeoffs, and if you don't understand when to optimize for your budget, you'll either ship garbage or never ship at all.
- TeMPOraL 8y agoI strongly agree. > Sometimes an extra sever or shard is cheaper than an extra programmer, or gets you to market on time. Sure, you're bailing yourself out by burning money. That's fine if it's all contained on your backend. My problem starts when similar situation happens on frontend - in the JS code of the website, or in the mobile app. Too often developers (or their bosses) will say "fuck it, who cares", as if their application was the only thing their customers were using on their machines. The problem with user-end performance is that suddenly, I can only run 3 programs in parallel instead of 30, even though I just bought a new computer/smartphone - because each of those 3 programs think they have the machine for themselves.
- gwbas1c 8y agoAn extra 20ms, or an extra sever, is very different than sloppy JavaScript bogging down someone's computer. That's crap code.