On 07/05/2016 10:06 AM, Jean-Marc Lasgouttes wrote: > The attached patch implements a cache around the function > GuiFontMetrics::breakAt, which has been identified as very slow by > Guillaume. To this end, I use a plain QCache object. > > This patch is also instrumented using pmprof.h. When I load the > UserGuide, and move along the document using Cursor-Down, I get the > following results: > > * Intel(R) Xeon(R) CPU E5-1620 v3 @ 3.50GHz, ubuntu 12.04, Qt 4.8.1 > > #pmprof# breakAt: 20.69usec, count=1651, total=34.16msec > hit: 63%, 3.54usec, count=1052, total=3.72msec > miss: 36%, 50.82usec, count=599, total=30.44msec > > > * Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz, ubuntu 16.04, Qt 4.8.7 > > #pmprof# breakAt: 221.85usec, count=4884, total=1083.54msec > hit: 83%, 2.29usec, count=4063, total=9.31msec > miss: 16%, 1308.43usec, count=821, total=1074.22msec > > > * Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz, ubuntu 16.04, Qt 5.5.1 > > #pmprof# breakAt: 4.20usec, count=16820, total=70.56msec > hit: 96%, 1.44usec, count=16267, total=23.43msec > miss: 3%, 85.23usec, count=553, total=47.13msec > > > One can see that the improvement between the hit and miss branches is > x500 with Qt 4.8.7, but only x14 with Qt 4.8.1 and x60 with Qt 5.5.1. > Note however that the miss path is much faster with Qt5 in the last > two examples (same machine). > > Comments welcome. My plan is to use that for both Qt4 and Qt5 (for > simplicity). Seeing the different behavior of Qt 4.8.1 and 4.8.7 > (albeit different machines), I suspect that the problem is elsewhere > in the configuration. > > I would be glad to have numbers from your on systems.
Can you give a receipe for producing them? I'm ignorant about profiling. (In my case, this would be on Linux.) Richard