-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Greatly speed up attribute table loading
Don't advise for rows added when a model reset is in progress. Otherwise the rows are tested for sort order, etc triggering a bunch of useless calculations, given that the model is in the process of being reset anyway. Tested using a 150k point shapefile, decreased attribute table load times from 50+ seconds to 4 seconds. Refs #16577, #16239
- Loading branch information
1 parent
af8fb04
commit b97a980
Showing
2 changed files
with
7 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b97a980
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Win!
b97a980
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
b97a980
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
b97a980
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elegant solution, but some questions:
when featureAdded would be called to trigger model reset? the end of editing? the end of coping, the end of something. Is it a way to move control outside the the MV qt model to a business function level?
b97a980
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feature added is used in two places - one is when the table is already visible and a new feature is actually added to the layer. The other is for every feature added to the table when the table is being loaded. This is when it's being used whole the model is being reset.
I'd say it's more of a workaround qt's model handling. I think any rowsAboutToBeInserted, ... should always be ignored if a model is in the process of being reset. But it seems this isn't the case, so adding the thousands of features when loading the table triggers a whole bunch of expensive sort handling after every feature is added.
b97a980
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for me :)
b97a980
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @nyalldawson
with your patch
2.18.8
rendering time:
real 0m38.663s
user 0m33.572s
sys 0m1.244s
so... quite slower in rendering my test 758k ploygon layer.
table:
it took 27 seconds to open the whole table, which is 10 seconds slower
than on 2.14.4
cheers!