I just made a 1-line change that improved my software's overall performance by 4x. That's a rare treat! #softwareengineering
@evan it's not "I fell off the jetway again" bad...
For anyone who cares: I had some digital signing code that I had built bottom-up, and I'd left the conversion from PEM data to a native key structure too far down the stack. It was getting called hundreds of times per minute. I didn't really give it a big thought, until I realized my program was CPU bound, and when I profiled it, the function with this call in it was running 67% of the time. So I moved the PEM-to-key call up a couple of levels, cached it, and got a 4x improvement in performance.
@evan
I think most programmers have been in that position before where their past self unintentionally made a performance issue blunder. I always try to be as forgiving of my past self as I would be for someone else who made an unintentional mistake.
(But it's hard because I'm my own hardest critic.)
@roytoo but it's great when you fix it and suddenly everything is fast!
@evan
Definitely is great when you see the solution and the performance improves significantly.
@[email protected] @[email protected] Early in my career I accidently wrote a parser for an open source project that restarted from the beginning of the string every character, going one further each time. Never been quite so embarrassed by a release note before or since: "[x] parser performance improved by three orders of magnitude on average config file"
@[email protected] @[email protected] The release note was from the next release that included the fix, given I apparently haven't had enough coffee to write clearly this morning yet.
@evan βwhy are you carrying that heavy anvil around in the desert?β β βthatβs because Iβm afraid of the lions. When I see a lion, I will immediately drop it and that lets me run much faster!β
@evan
Glad you found and made the fix. It is such a delight when fixes like that can be done.