Bug 308657 - Performance problem in KWrite::readConfig
Summary: Performance problem in KWrite::readConfig
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: kwrite (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-19 12:55 UTC by BRULE Herman
Modified: 2012-10-24 10:59 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.10


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description BRULE Herman 2012-10-19 12:55:47 UTC
Hello, when I open 100x .cpp + .h file, I have very big performance problem. I need wait more than 90min to open it.
See the attached file to have the profile.
90% of the time is into KateGlobal::readConfig(KConfig*)
Read only one time this config, and general optimization in this case, can be useful for the user experience.
I'm under linux, with radeon HD 5450 with open source drivers.

Thanks to fix it, to have correct open of multiple file.

Reproducible: Always
Comment 1 BRULE Herman 2012-10-19 13:01:24 UTC
I'm under kde 4.8.5
http://files.first-world.info/temp/callgrind.out.4420.gz
Comment 2 Dominik Haumann 2012-10-20 11:35:45 UTC
What happens, if you open these 200 files in Kate instead of KWrite?
Comment 3 BRULE Herman 2012-10-20 15:30:55 UTC
No performance  problem with kate.
Comment 4 Dominik Haumann 2012-10-21 20:05:41 UTC
It's because KWrite calls the Editor's readConfig for each MainWindow. This is redundant, as the global config is the same for all main windows. So this should be done only once, as can be seen in the backtrace.

Pseudo backtrace:
KWrite::readConfig()
KWrite::readConfig(KSharedConfigPtr config)
KTextEditor::Editor::readConfig(config.data())
Comment 5 Dominik Haumann 2012-10-24 10:57:39 UTC
Git commit aac62d627e69d6cfc548bbfef1e85545c858c94e by Dominik Haumann.
Committed on 24/10/2012 at 12:55.
Pushed by dhaumann into branch 'master'.

Call Editor::readConfig() with KGlobal::config() as parameter only once

M  +3    -0    kwrite/kwriteapp.cpp
M  +6    -1    kwrite/kwritemain.cpp

http://commits.kde.org/kate/aac62d627e69d6cfc548bbfef1e85545c858c94e