-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Improve vector source clear() performance #3013
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 vector source clear() performance #3013
Conversation
Three seconds speed up for clearing 100'000 features.
Three seconds speed up when clearing 100'000 features. Clearing is now around 350ms.
This is a significant improvement! We need to have this. The only problem is that it may break applications that expect a One option is to add an |
@elemoine, I added the |
@@ -37,7 +37,15 @@ ol.source.VectorEventType = { | |||
CHANGEFEATURE: 'changefeature', | |||
|
|||
/** | |||
* Triggered when a clear is called on the source. |
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.
-> Triggered when the clear function is called on the source.
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.
Fixed.
Minor comments, otherwise looks very good to me! |
85a0538
to
e3947fb
Compare
LGTM. |
@elemoine, please merge. |
Improve vector source clear() performance
Thanks for updating the patch. |
Speeds up from 8 seconds to 350ms the clearing of 100'000 features.
This 24 times improvement is in part gained by dispatching a single
clear
event in spite of sending aremovefeature
event for each of the 100'000` features.