| ▲ | hinkley 2 hours ago | |
> human-perceptible range allows me to use my intuitive sense of time and speed I didn’t intend to specialize in performance early in my career but it happened anyway. I tuned boring homework assignments to make them more interesting for myself. But I moved far away for my first gig out of school and when I showed up the UI painted so slow it looked like one of those videos of an artist drawing something by hand but sped up. I hid my panic at having my name associated with this stinking pile and as soon as I’d done a couple of challenging bug fixes to prove I wasn’t an idiot I got to work. My first dozen changes needed no benchmarks, In part because I had the slowest machine in the office. I could literally count seconds in my head and tell that I’d taken >1/4 of a second off of an operation because I made it a syllable or two farther in the old version. Later on I used the stopwatch function on a handheld device, to catch 100ms differences. I was there for nearly two months before I needed to put console output of (end - start) into the code for the first time. By the time I started running out of stuff I knew how to fix, the corpus of data had started showing a serious scalability problem in the data filtering operations, so we were back into classical architectural misdeeds. We had a 2n logn² intersection test that did two scans on different criteria and compared the results using a quadratic time comparison. This code was copy pasta’d in dozens and dozens of places around the project, with slight variations in variable names and parameter marshaling. I replaced all the copies with one function they did filter(filter(x)) over a long holiday weekend since I had nobody local. -500 lines of code and much much lower slope of call time on multi year data sets. | ||