17/04/2013 00:05, pdv:
I do now all the width-calculations in one function. In that function the widths are cached in a map<docstring,int>. I then obtain again a substantial speed increase. For testing I defined a static map, but I assume that eventually the map should be stored in a suitable object so that the map doesn't grow out of proportion.
You need to keep one map for each FontInfo instance (like what is done for singleWidth). I agree that may use a lot of memory. This is something that can be measured using the massif tool of valgrind.
So far I can handle all basic content properly. I haven't paid much attention to inlinecompletion (at one point it posed no problem, but I have to check that again), but I just discovered an issue with the Labeling style ...
Great. If you want to do basic timing before/after, have a look at support/pmprof.h.
Can we see the patch? JMarc