3 ms·
On mobile devices it is more serious than just bad craftsmanship & hurt pride, bad code is short battery life. Think mobile game that could last 8 hours instea
by hamstergene 4y ago
On mobile devices it is more serious than just bad craftsmanship & hurt pride, bad code is short battery life.
Think mobile game that could last 8 hours instead of 2 of it wasn’t doing unnecessary linear searches on timer in JavaScript.
- ben_w 4y agoThere was one place where a coworker had written a function that converted data from a proprietary format into a SQL database. On some data, this took 20 minutes on the test iPhone. The coworker swore blind it was as optimised as possible and could not possibly go faster, even though it didn't take that long to load from either the original file format or the database in normal use. By the next morning, I'd found it was doing an O(n^2) operation that, while probably sensible when the app had first been released, was now totally unnecessary and which I could safely remove. That alone reduced the 20 minutes to 200 milliseconds. (And this is despite that coworker repeatedly emphasising the importance of making the phone battery last as long as possible).
- xigoi 4y agoThis is why all programmers should know their asymptotic complexity.
- BeFlatXIII 4y agoAs the poster child of poor performance even on new iPhones, there is always Pokémon Go (produced with Niantic levels of competence)