Improving GTK Text Performance

about | archive


[ 2005-November-05 15:40 ]

Frederico Mena-Quintero has written an interesting series of posts about improving GTK text performance. This provides an interesting case study on how performance work is done. The story begins by adding a cache to avoid an expensive font lookup. The latest update has a table of contents, and is particularly interesting. In it, Frederico presents the performance of various cache sizes, and concludes that a 256 entry cache is best. It is interesting to note how much the performance varies for some languages when the cache size changes. Additionally, the cache actually hurts the performance of a couple languages, likely because they have so many misses that it does not provide any benefit. This shows that careful benchmarking and cache tuning are very important for good performance. I would suggest that this benchmark needs to be run using different CPUs, because I suspect that the CPU cache plays a big role in this particular experiment. I am also curious if different mapping functions could help. Using the lowest byte as a cache index is very fast, but it also may be causing conflict misses for non-Latin character sets. Maybe some combination of the lowest two or three bytes would be better?