Re: Factor

Factor: the language, the theory, and the practice.

Faster Tables!

Tuesday, September 18, 2012

#performance

We’ve known for awhile that the Factor user interface is a little bit slow when displaying tables with many rows. I wasn’t sure this was a big problem until a detailed bug report was filed (thanks @k7f!) that pointed out the opengl.gl vocabulary (with over 2,000 symbols in it) was “virtually unscrollable”.

After poking around at the profiler output, I noticed that some UI gadgets had “baseline alignment” support which was used in the layout process. Some of these calculations were quite expensive and could easily be cached.

After a few changes, and introducing the concept of an “aligned gadget” which provides a mechanism to cache these alignment calculations, the original test case is almost 10 times as responsive as before!

This is available in the master branch on GitHub.