Bug 403751 - very slow filtering of bibliography
Summary: very slow filtering of bibliography
Status: RESOLVED FIXED
Alias: None
Product: KBibTeX
Classification: Applications
Component: General (other bugs)
Version First Reported In: git (master)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Thomas Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-30 00:41 UTC by Gandalf Lechner
Modified: 2019-02-27 22:21 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In: 0.9
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gandalf Lechner 2019-01-30 00:41:59 UTC
In recent checkouts from master, I experience very slow behavior of the filtering (Ctrl+F) of the bibliography - it takes several seconds during which the program is unresponsive. In 0.8.1, filtering works instantly with the bib file (about 1500 entries).
Comment 1 Thomas Fischer 2019-02-25 16:35:45 UTC
I can confirm this performance regression. I am almost certain which code section is responsible and will look into fixing it.
Comment 2 Thomas Fischer 2019-02-26 22:09:27 UTC
Please check if the problem has been fixed in commit defbd6867137ca available here:
https://commits.kde.org/clones/kbibtex/thomasfischer/kbibtex/defbd6867137ca16699116015945e81fcad99b2c

To test the code, have a look at the "Quick Start" instructions:
https://userbase.kde.org/KBibTeX/Development#Quick_Start_to_Run_KBibTeX_from_Git
Run script run-kbibtex.sh as follows:
bash run-kbibtex.sh "https://anongit.kde.org/clones/kbibtex/thomasfischer/kbibtex.git" "bugs/kde403751"

Please test and confirm if that commit fixes your performance issues.
Comment 3 Gandalf Lechner 2019-02-26 23:47:14 UTC
that commit has fixed it for me, thanks!
Comment 4 Thomas Fischer 2019-02-27 22:20:55 UTC
Git commit 388b867499d03403c7b60ffed8b6b9ee12993eca by Thomas Fischer.
Committed on 27/02/2019 at 19:49.
Pushed by thomasfischer into branch 'kbibtex/0.9'.

Avoid accessing configuration file all the time

In commit 36040dc280ccb3ad, a first step towards a centralized configuration
system was undertaken. A single static function in a central class became
available to probe whether the current bibliography system was BibTeX or BibLaTeX.
To allow for synchronization between multiple instances of KBibTeX programs and
KParts, configuration values were read from configuration files every time this
setting got queried.
This approach introduced a noticeable performance penalty as reported in bug
report 403751, requiring a rewrite of this code section.

To avoid reading/writing from/to configuration files at every function call got
avoided by making use of KConfigWatcher, a DBUS-based solution to notify other
processes' instances of a KSharedConfig object about changes made to the
configuration. Only if such notifications get received a re-read from configuration
files is necessary, otherwise a cached setting value is used.

Those changes also required to refactor previously static functions of class
Preferences to become regular functions called on a singleton instance of
Preferences.
FIXED-IN: 0.9

M  +1    -1    CMakeLists.txt
M  +2    -2    src/config/bibtexentries.cpp
M  +2    -2    src/config/bibtexfields.cpp
M  +85   -18   src/global/preferences.cpp
M  +22   -6    src/global/preferences.h
M  +2    -2    src/gui/config/entrylayout.cpp
M  +2    -2    src/gui/element/elementwidgets.cpp
M  +2    -2    src/gui/element/findpdfui.cpp
M  +3    -3    src/gui/preferences/settingsgeneralwidget.cpp
M  +2    -2    src/io/fileimporterris.cpp
M  +2    -2    src/networking/associatedfiles.cpp

https://commits.kde.org/kbibtex/388b867499d03403c7b60ffed8b6b9ee12993eca
Comment 5 Thomas Fischer 2019-02-27 22:21:04 UTC
Git commit 67420b74329be7e5a97da0644a76a35ddacef9f8 by Thomas Fischer.
Committed on 27/02/2019 at 19:47.
Pushed by thomasfischer into branch 'master'.

Avoid accessing configuration file all the time

In commit 36040dc280ccb3ad, a first step towards a centralized configuration
system was undertaken. A single static function in a central class became
available to probe whether the current bibliography system was BibTeX or BibLaTeX.
To allow for synchronization between multiple instances of KBibTeX programs and
KParts, configuration values were read from configuration files every time this
setting got queried.
This approach introduced a noticeable performance penalty as reported in bug
report 403751, requiring a rewrite of this code section.

To avoid reading/writing from/to configuration files at every function call got
avoided by making use of KConfigWatcher, a DBUS-based solution to notify other
processes' instances of a KSharedConfig object about changes made to the
configuration. Only if such notifications get received a re-read from configuration
files is necessary, otherwise a cached setting value is used.

Those changes also required to refactor previously static functions of class
Preferences to become regular functions called on a singleton instance of
Preferences.

M  +1    -1    CMakeLists.txt
M  +2    -2    src/config/bibtexentries.cpp
M  +2    -2    src/config/bibtexfields.cpp
M  +85   -18   src/global/preferences.cpp
M  +22   -6    src/global/preferences.h
M  +2    -2    src/gui/config/entrylayout.cpp
M  +2    -2    src/gui/element/elementwidgets.cpp
M  +2    -2    src/gui/element/findpdfui.cpp
M  +3    -3    src/gui/preferences/settingsgeneralwidget.cpp
M  +2    -2    src/io/fileimporterris.cpp
M  +2    -2    src/networking/associatedfiles.cpp

https://commits.kde.org/kbibtex/67420b74329be7e5a97da0644a76a35ddacef9f8