People go through a few different stages of programming Python, and one of the last is learning to optimize well and without sacrificing the quality of the code. When a piece of code is bottlenecking, it comes time to look at how you can really turn a turtle into a hare. Or, should that be the other way around?
I want to showcase ways this transformation is possible so I'm going to make a call for anyone to submit code that needs optimized. The next post in this series will show how the code was optimized, what techniques might have been tried and would have failed, and maybe some tips about why the changes worked. There will also be a sample of unoptimized code at the end, with the challenge for improvements to be sent in. From there, if the series has interest, it will continue and maybe evolve.
Send in samples of code you think could be faster. They can be real world or fake, as long as they are realistic. It doesn't matter how poorly written they are, but we need to know what it does. It needs to actually work. The best submissions will be a single function and a docstring that tells me what it can be called with and what it should be expected to do. Things that can unittest well and don't rely on things from the outside are best.
So, impress me, everyone, with the worst code you've got.
I write here about programming, how to program better, things I think are neat and are related to programming. I might write other things at my personal website.
- ► 2014 (52)
- ► 2012 (19)
- ► 2011 (19)
- ► 2010 (32)
- ► 2008 (28)
- How To Stop Me From Buying An iPod Touch
- How to Confuse _ and locals()["_"]
- How to Pretend Zope Doesn't Exist
- How to Add Memory Leaks to Python
- Python, Concurrency, and My Two Cents Today
- How to Shop for a Portable Device
- How to Exploit All of You For Traffic
- How to Improve on CouchDB
- Charlotte Python Group: First Meeting
- Brain Dump 20070904
- ▼ September (10)