May. 6th, 2020

izard: (Default)
I was recently working on a problem, where one of the performance metrics I measured was ~100x higher than expected. It is almost impossible to make a 100x optimization, unless something is severely broken...

In the end, it appeared to be my error. But it was not a measurement error, I triple checked my measurement code and it was correct.

The buggy part was printing the end result. I made a typo in printf format, "%ull" instead of "%llu", so it printed "ll" in the end. Then I mistook "ll" for "11" when reading, and this multiplied the result 100x. I was slightly curious why random performance readings always end with 11, but I still did not catch it. Only after I pasted the result to Excel to plot a graph I realized what went wrong.
This made it in my list of top 5 stupid programming errors I ever made :)

Profile

izard: (Default)
izard

July 2025

S M T W T F S
  12345
67 8 91011 12
13141516171819
20212223242526
27 28293031  

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 13th, 2025 09:58 am
Powered by Dreamwidth Studios