New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce startup time (because QSettings from resource is slow) #985

Merged
merged 1 commit into from Aug 7, 2018

Conversation

Projects
None yet
2 participants
@frsfnrrg
Contributor

frsfnrrg commented Aug 5, 2018

This PR significantly reduces startup time by caching information about the default schema settings.

Having briefly tested schema changes/additions/modifications, the changes don't seem to have introduced any new bugs, although I may not have gotten to all the edge cases.

I've tried to match the existing code style, but haven't found a style guide or autoformat specification. Let me know if there's anything you want me to adjust.

Only load :/configurations/schemes.conf once
Replace of the methods provided by Utils::Schema with a singleton class,
since access information for the default schemas can be cached as those
are fixed. This saves up to 50% of startup time, as initializing
QSettings from a resource can be expensive.
@pbek

This comment has been minimized.

Owner

pbek commented Aug 6, 2018

Thank you for your concern. On what operating system did you perceive a long startup time?

@frsfnrrg

This comment has been minimized.

Contributor

frsfnrrg commented Aug 6, 2018

Linux with Qt 5.11.1, on a somewhat old system, this PR drops from ~3s to ~1.5s the time until the GUI is usable. (Profiling with callgrind explains this, insofar that QSettings(":/...") constructors are expensive due to uncompressing data each time).

@pbek pbek merged commit 3560f33 into pbek:develop Aug 7, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@pbek

This comment has been minimized.

Owner

pbek commented Aug 7, 2018

There really is a great improvement. Thank you very much for your contribution!

@pbek pbek added the enhancement label Aug 7, 2018

@pbek pbek added this to the 18.08.2 milestone Aug 7, 2018

@pbek

This comment has been minimized.

Owner

pbek commented Aug 7, 2018

18.08.2

  • significantly reduced application startup time (for #985, a big thank you to @frsfnrrg)
@pbek

This comment has been minimized.

Owner

pbek commented Aug 7, 2018

There now is a new release, could you please test it and report if it works for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment