[PATCH] WIP: rewrite statistics code

Jean-Marc Lasgouttes lasgouttes at lyx.org
Sun Jul 21 22:32:28 UTC 2024



The statistics code is known to be very slow, because it relies on
DocIterator to go through the buffer.

This commit introduces a new Statitistics class that encapsulates the
main code, along a virtual method Inset::updateStatistics() that
allows to fine-tune how counting is done inset by inset.

In order to check that it works, the old code is not removed yet, and
Tools>Statistics displays the result of the two methods on the
console. I used in particular the user guide to check that the results
are the same.

The display in the status bar has switched to the new code.

The commit does also some profiling with pmprof and outputs some
timings when exiting LyX. I see consistently that the new code is 3x
faster.

Of course, this duplicated code will be removed when finalizing the
commit.

Please test.

JMarc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-WIP-rewrite-statistics-code.patch
Type: text/x-patch
Size: 19899 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20240722/bbd8160f/attachment-0001.bin>


More information about the lyx-devel mailing list