The query had been running fine for months. It pulled ad performance summaries by dealer: counts, impressions, nothing exotic. Then one morning it stopped finishing. Timeout after timeout, and nobody had changed the code.What had changed was the data. AdEvents had grown from a few hundred thousand...
Achieve true multi-core parallelism in Python by disabling the GIL! Introduction When I was learning Python, I started using threads in some programs to speed up execution because I already knew threading in other languages such as Java and C. So I just assumed that things worked the same. For...
Send files 2x faster using Linux kernel’s sendfile syscall! Introduction When building web applications or file servers in Python, sending large files over the network is a common requirement. Whether you’re serving video files, database dumps, or large datasets, the traditional approach of...
Match strings 3x faster! Introduction Often times we use Python’s RegEx module re to handle more complex string matching. That is great and a no-brainer. It takes a bit of time to come up with a not-so-unreadable regex that works perfectly for your use-case. Specific use-cases that might...
Reference counting is cheap and easy. An integer starts at one, increments on every new reference, and whoever decrements it to zero is responsible for deallocation. If references are shared across threads, increments and decrements must be atomic. Decades ago, I wrote an audio library that...
Update: The dhang is now available for preorder, and you can join a workshop to build it yourself! Feedback from first user testing of the dhang digital hand drum was that the latency was too high. How did we bring it down to a good level? dhang: A MIDI controller using capacitive touch sensors...
The key to performance is elegance, not battalions of special cases.Jon Bentley and Doug McIlroy We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.Donald Knuth This is an unfinished blog post started some two-and-a-half years ago...
When software goes slow, generally, the first reaction is to profile. This might be done through system tools (like Instruments on OS X, perf/valgrind/etc on Linux, VTune, etc). This is fine and good, but just because you have the output of a tool does not necessarily correlate to understanding...
We’ve struggled for a long time to programmatically measure the objective performance impact of add-ons on Firefox. While a perfect solution is still far off, we’ve recently started down an interesting new avenue: automatically measuring the impact of add-ons on the computer power consumption...