This improves caching introduced in https://github.com/geany/geany/pull/2747 and discussed in https://github.com/geany/geany/issues/2883 This change reduce CPU usage on window activate/deactivate by caching up to 128 elements from all SCI_TEXTHEIGHT calls. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/2934
-- Commit Summary --
* <a href="https://github.com/geany/geany/pull/2934/commits/7d8c3fefbdcd55f819969ec316687a349393096e">Improve caching for SCI_TEXTHEIGHT</a>
-- File Changes --
M src/sciwrappers.c (95) M src/sciwrappers.h (1) M src/symbols.c (2)
-- Patch Links --
https://github.com/geany/geany/pull/2934.patch https://github.com/geany/geany/pull/2934.diff
@rozhuk-im pushed 1 commit.
5cd59f7c4523fca3ed62e97359779a1a2a195e6a Improve caching for SCI_TEXTHEIGHT
This change should be backed up with some metrics. The added complexity must be justified.
Have no idea how to bench it, may be @b4n know.
Agree with @kugel- that there seems very little point in caching height of each line when all lines are the same height, guaranteed by Scintilla ["All lines of text in Scintilla are the same height"](https://www.scintilla.org/ScintillaDoc.html#TextRetrievalAndModification) so need to show it solves some actual problem.
Requesting text height from Scintilla in `goto_popup_position_func()` is unlikely to be significant given that function then creates and renders a menu popup which will be much more expensive.
github-comments@lists.geany.org