A Brief Intro to Profiling in Python
speakerdeck.com
speakerdeck.com
I really want to start a campaign to get something similar built for JavaScript. JavaScript has the most diverse user base (from people who barely know how to use their computers all the way up to Googlers), yet our profiling tools can be intimidating/hard-to-decipher even for people who are quite comfortable with the rest of the language.
My mental model for my code is my code. Showing me a data-grid with a tree of function calls (many of which may be in external libraries I don't control) isn't nearly as helpful as showing me, line-by-line, how fast my code runs. (This is especially true since not every line that takes time to run makes a function call.)
I'm working through some of CPU overhead issues with Django now and wishing occasionally that I had chosen to use Sqlalchemy as my primary database tool. Django seemed like the easier solution at the time because of the steep learning curve of Sqlalchemy. I think it's worth learning, especially now that I've hit some edges in Django's ORM. I suppose it's good to know I can always use a crazy hybrid of the two libraries if needed.
It seems like it's not going to go away any time soon. I'd be surprised if most new work was even being done in python 3, even though it's been out for almost 5 years now.
And, if you've got a serial column, you're going go have a primary key/uniqueness constraint on it. Retrying that when it fails at interesting times is going to cost far more time and brain cells than letting the db do it.