slow-mo highlights

Apple’s Cocoa framework contains a versatile NSTableView class. When selecting a row, interestingly, the selection highlight has a few possible styles, such as Source List. As with many visual things, textual descriptions are inadequate because the visual objects must be seen in context. Well, I tried it and came to the conclusion – I like it, but the UI feels slow.

In the reference documentation, I notice a cryptic note saying if you use Source List style, you must not modify a cell view’s background because they will draw over each other. Hm, instead of you must not, it really should say you should not, and then give a better explanation why. In Pokelog, I do use background colors, but I wanted to see what Source List looks like. It works – it is not forbidden – and I did not notice any buggy behavior such as drawing artifacts. The colors seemed to composite okay, as much as might be reasonably expected. However, the style seems to incur extra UI drawing, regardless of whether a row is highlighted.

The extra drawing does not mean the screen updates slowly, like a teletype terminal over dial up modem. In fact, the screen updates quickly enough that the momentary slowness simply felt like the computer was coincidentally busy with other computation. But after repeated experiences, I decided to measure it with my imprecise method – I counted to myself, in approximate seconds, how long it takes to scroll through 2k rows: almost twice as long. That convinced me, use Source List style highlighting with care.