Reading urlopen and probably any file-ish things in python fast

So I’ve been churning away in my last few days in Delicious-land trying to optimize some python code.

I was doing essentially this:

and it was taking almost a minute… for a ~3000 line json feed. Being the n00b that I am, I started getting my python learn on… and thought… an open url connection seems like a bad idea… let’s do this:

Zoom! Took less than a second… actually putting real code in their (e.g. simplejson.loads()) bumped it to 2 seconds. Hooray.