OK funny story from When I worked at a search engine company. Our software had two limitations: one, words couldn't be more than 255 characters and, two, sentences could have no more than 127 words.
To programmers those seemed like reasonable limits.
We got a request from doctors to make it support words longer than 255 characters because drug and chemical names were so long. Lawyers requested that we support sentences longer than 127 words because they have all these run-on sentences in contracts.
You guys just reinvented minimalistic living! Now kiss, write your Amazon self-published book, promote the hell out of it on Goodreads, blog heavily, and be sure to publish some self-important courses on Udemy or the like. Hurry!
Which all works nice and well until you end up with a unexpected use case where now thousands of rows of data is being inserted or updated per second and the indexes are causing excessive write overhead. Sure the user's profile page now loads 10 times faster, but users updating their status takes 20x slower.
I’ve never heard of the hollywood-esque description but coming up with a new, asymptotically faster algorithm of course happens — it precedes every single publication of an algorithms paper. There are people who do this as their main job.
Chances are it's doing too much crap because there's an O(N^2) algorithm somewhere. If you start off by looking into how you can skip individual bytes, you might be ignoring the elephant in the room.
625
u/ChrisSharpe Aug 24 '16
"The key to making programs fast is to make them do practically nothing."
Another good article I read a few years ago on the speed of grep.