10 ms·
In the midnineties I was hired to improve the performance (and eventually rewrite) a custom in-house search engine. I dipped into the software and there were so
by kieckerjan 9y ago
In the midnineties I was hired to improve the performance (and eventually rewrite) a custom in-house search engine. I dipped into the software and there were some quick wins, but I couldn’t get the damn thing to reply quicker than 100 ms. In desperation I just grepped for the number 100 and sure enough I found a 100 ms sleep in the routines handling the connections. Turned out the author had made a mess of his socket handling and by trial and error had found out he could get the thing to work reliably only by waiting for a while.
- jcranberry 9y agoI can vividly imagine finding this kind of bug through a random feel and briefly feeling great relief before flying into an apoplectic rage haha
- krylon 9y agoAn SAP consultant once told me that his preferred technique of averting long-winded and pointless discussions about irrelevant details was to insert random delays into his code. That way, instead of discussing irrelevant details, people would get upset about the performance. He would then sigh, dramatically, and say he would see what he could do, remove a few lines, spend the rest of the day reading the news, and - importantly - billing the customer.
- jhanschoo 9y agoI'm pretty sure I've seen this before, is it one of the BOFH stories?
- krylon 9y agoI am too lazy to check right now. ;-) Honestly, this story was told to me by an SAP consultant. I do not think he was an avid reader of BOFH. I might be wrong though. Either way, I think this approach to avoiding bikeshedding has been invented independently numerous times. ;-)
- codfrantic 9y agoclose: https://thedailywtf.com/articles/The-Speedup-Loop https://thedailywtf.com/articles/The-Speedup-Loop
- shoo 9y agothere's also the memory-optimization variant of this, from the land of game dev. see "the programming anti-hero": https://www.gamasutra.com/view/feature/132500/dirty_coding_tricks.php?page=4 https://www.gamasutra.com/view/feature/132500/dirty_coding_t... most of the other game dev dirty trick on gamasutra are good value -- the "(s)elf-exploitation" one from Jonathan Garrett, Insomniac Games is particularly awfully clever: https://www.gamasutra.com/view/feature/194772/dirty_game_development_tricks.php?page=1 https://www.gamasutra.com/view/feature/194772/dirty_game_dev...
- jakevoytko 9y agoI once found a "sleep(1000);" in the middle of some hairy critical code -- something existentially important like payment processing. There was no obvious reason for it, it had been added without explanation, and the author was long gone from the company. I didn't have the guts to remove it.
- lgl 9y agoHaving an important endpoint delay every response by 1 second (assuming the 1000 are ms) is a relatively common and easy way to delay brute force attacks. E-mail servers call this tarpitting.