too early to brag yet, because my client hasn't had a chance to test it... but I'm hopeful. I took on a job yesterday afternoon which was out of my comfort zone, a Python script optimization using array arithmetic to figure out optimal groupings of objects each of which has several key parameters. to be more precise, it's a fantasy football program.

I spent hours trying to profile the goddamned thing to find the hotspots. I got it down to one or two routines, but cProfile is too coarse-grained to give me the detail I needed; either that, or I just suck at using it. anyway, I figured it was the additions of the various parameters that was taking most of the time, so I laboriously converted the objects to subclasses of Numpy ndarrays, which almost worked (it did work while profiling was on, and broke on its own) but was over an order of magnitude slower than before. so at around 0500 I went to sleep for a few hours, reverted to the old code, and took another look. I found an expensive computation that didn't need to be done unless another one was within cetain bounds! so I moved it into the conditional block after the more crucial computation, and I had about a 30% speed improvement. I'm hoping that's good enough to earn my money.

I'm thinking about going to El Parnazo for a beer later. but I'd really like to know if the job is done first. a liter of Pacifico is not good for the programming mindset.

Back to blog or home page

last updated 2016-01-06 17:38:25. served from tektonic.jcomeau.com