[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lyx-devel
Subject:    Re: [PATCH] a poor man's profiler
From:       Vincent van Ravesteijn <vfr () lyx ! org>
Date:       2013-03-24 15:38:49
Message-ID: 514F1E09.7050502 () lyx ! org
[Download RAW message or body]


> As an exercise, I would be interested to see the output (in particular 
> on windows and mac) of the following Messages instrumentation
>  * with USE_CACHE defined (as it is now)
>  * without it.

Well, the code wass not exactly portable to Windows, but here are some 
results:

Without cache:
     ##### Message_get: 220.961usec, count=176307
With cache:
     ##### Message_get: 2.42133usec, count=411687

More importantly, LyX is unusable without the cache. It seems that every 
time one presses <Enter> in Lyx, there are 11826 requests for 
translation of a certain export type, like "PDF (XeTeX)", 
"OpenDocument", "LyXHTML", etc. This adds up to a stunning 2.6 seconds.

This is caused by updating the toolbars. For each format it is checked 
whether LFUN_BUFFER_UPDATE and LFUN_BUFFER_VIEW are enabled. Each time, 
BufferParams::isExportableFormat is called. This function calls 
exportableFormats which will find all reachable formats and sorts the 
list. In each comparison while sorting, there are 2 requests for 
translation.

Vincent
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic