Skip to content
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

Improve performance on "big" files #6

Merged
merged 2 commits into from Apr 20, 2019

Conversation

jeanthom
Copy link

@jeanthom jeanthom commented Apr 20, 2019

This PR is focused on improving performance when loading "big" files.

I used Apple's Instruments.app to tell me where we were wasting CPU time. With no changes we had a graph like this :

Capture d’écran 2019-04-20 à 13 23 49

"Spinning" means that the GUI is frozen, in reference to macOS's beach ball icon spinning when the application is unresponsive

Looking at the profiler output, we can see that most of the time was spent in USBModel::updateNodes().

Capture d’écran 2019-04-20 à 13 11 52

By making fewer calls to this method, I did shave a few seconds off:

Capture d’écran 2019-04-20 à 13 33 09

By looking at the profiler output even closer, I noticed that we spent too much time in QAbstractItemModel's endInsertRows() method. I decided to make fewer calls to endInsertRows and beginInsertRows() (they go in pairs). That improved a lot the loading times!

Capture d’écran 2019-04-20 à 13 36 06

All my tests were performed on this file:
ft4232trace.usb.zip

@jeanthom jeanthom mentioned this pull request Apr 20, 2019
@smunaut
Copy link

smunaut commented Apr 20, 2019

Just tried this and it's now really fast ... about 20 - 25x faster on one sample file.

@key2 key2 merged commit 933fa3b into lambdaconcept:master Apr 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants