Aug 10th, 2014

The streak continues.

I made a bit of detour into the Story/Tag drawing code and made a few changes to clear it up.

Surprisingly, what started as a simple cleanup inadvertently turned into optimization. Better separating the prep and drawing logic, which includes locking operations that can take longer than you expect (and certainly much longer than when the drawing code was initially written in the single-threaded days) seems to have made it snappier than expected. So much that, in addition to writing this post, I’m wondering if there wasn’t a subtle cache bug that I now fixed unknowingly.

The changes also made it pretty easy to test whether the cache memory usage was worth it. Long story short, it absolutely is. Without the caches, the memory dips a small amount, but the interface crawls. With the caches on, I can still have a few hundred items knocking around smoothly and memory usage is still like a third of an empty instance of gedit based on htop RES.

Leave a Reply

Your email address will not be published. Required fields are marked *