4 ms·
I got a 1000 X speedup by removing a sleep(100000) line once. Not as impressive though.
by AznHisoka 13y ago
I got a 1000 X speedup by removing a sleep(100000) line once. Not as impressive though.
- wiredfool 13y agoI got a 2gb reduction in memory usage and orders of magnitude speedup by adding an _ in one line once.
- Dylan16807 13y agoCare to explain that? I don't get it.
- wiredfool 13y agoIt was a long involved bug chase, but some django middleware had an optional cache of some s3 information. The actual variable was self._something, with an @property on self.something so that the getter would backfill the metadata if it didn't exist. In the code, it was checking if self.something existed, and then doing something else if it didn't. This triggered the lazy getter, and had the effect of pulling in the metadata for a 300k item s3 bucket. Checking for self._something correctly returned None, it then checked s3 for the item, and uploaded it directly.
- pkolaczk 13y agoAnd I got an infinite memory usage improvement by adding one missing delete once. :D
- xster 13y agoYa, the title is pretty link bait-y. Just think of all the people who clicked the link and then found out they have no interest in sorting. Title: I saved the world!!!#$^%!1111 Content: I was about to step on an ant today and narrowly missed it, saving the universe and all of existence for that ant.