Shall we drop resources ?
Jean-Marc Lasgouttes
lasgouttes at lyx.org
Mon May 18 15:31:08 UTC 2020
Le 18/05/2020 à 16:42, Pavel Sanda a écrit :
> On Fri, May 15, 2020 at 11:10:01AM +0200, Jean-Marc Lasgouttes wrote:
>> Le 14/05/2020 ? 23:40, Jean-Marc Lasgouttes a écrit :
>>> Le 14/05/2020 ? 22:29, Jean-Pierre Chrétien a écrit :
>>>> My computer uses mechanical drives all right, and runs an AMD
>>>> biprocessor since 2009. Does it seem enough disabled for a test ? If so,
>>>> what should I do exactly ?
>>>
>>> Very good platform. Apply this patch (which is work in progress but should
>>> work) and recompile lyx in release mode.
>>>
>>> Then reboot your computer (to avoid caching of files), run LyX, create new
>>> file, insert math equation (to have more icons) and exit.
>>>
>>> Note what is output on screen.
>>>
>>> Then in GuiApplication/iconName() and repalce the "#if 1" by "#if 0" (see
>>> in the patch). Recompile, repeat the same measurement.
>>>
>>> Is this clear enough ?
>>>
>>> Note that there are other uses of the resources in the code, I am just
>>> testing this particular path.
>>
>> Try this one instead (do not worry, recompilation will be limited).
>
> 10 y old machine with rotat. disk;
> ./configure --enable-debug --enable-profiling --enable-optimization=-O2
> (if you really want release mode I can rerun, but it takes lot of time
> to recompile :)
>
> case 1 (#if 1)
> a) empty cache (echo 3 > /proc/sys/vm/drop_caches)
> #pmprof# getIcon: 6.32 ms, count=221, total=1.40 s
> b) reload with cache after a)
> #pmprof# getIcon: 1.53 ms, count=221, total=337.32 ms
>
> case 2 (#if 0)
> a) empty cache
> #pmprof# getIcon: 2.33 ms, count=223, total=519.26 ms
> b) reload with cache after a)
> #pmprof# getIcon: 955.58 us, count=221, total=211.18 ms
So we can gain a noticeable time using resources. Do you use svg or png
icons? Processing of svg icons is really more expensive than loading
them from disk.
Jürgen, returning to your original argument about being able to override
icons, I suspect that reading in the order
1/ userdir
2/ resources
3/ sysdir
would be OK, right?
Or maybe you do not care that much anymore?
> What is interesting is not time for math but time for new document!
> Even with cache I am waiting for about ~5s for new document to appear.
> We had to screew something badly because 2.3.x gives ~0.5s (or I am
> paying for --enable-debug --enable-profiling).
What you are seeing is probably python converting old textclasses. This
is not supposed to happen for a release. We will eventually update all
our files to latest version.
JMarc
More information about the lyx-devel
mailing list