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

FeatureLevelRemove- and SourceLevelRemove-Benchmarks in remove_paint_state.js are exactly the same #10049

Open
JannikGM opened this issue Oct 23, 2020 · 0 comments

Comments

@JannikGM
Copy link

Unless I'm missing something, both benchmarks were already the same when they were added in #7761 by @peterqliu :

export class FeatureLevelRemove extends RemovePaintState {
bench() {
for (let i = 0; i < this.numFeatures; i += 50) {
this.map.setFeatureState({source: 'land', id: i}, {bench: true});
}
for (let i = 0; i < this.numFeatures; i += 50) {
this.map.removeFeatureState({source: 'land', id: i});
}
this.map._render();
}
}

export class SourceLevelRemove extends RemovePaintState {
bench() {
for (let i = 0; i < this.numFeatures; i += 50) {
this.map.setFeatureState({source: 'land', id: i}, {bench: true});
}
for (let i = 0; i < this.numFeatures; i += 50) {
this.map.removeFeatureState({source: 'land', id: i});
}
this.map._render();
}
}

I haven't used these APIs yet, but I believe the SourceLevelRemove should have used something like this?

// No loop
this.map.removeFeatureState({source: 'land'}); 

Maybe also source-property level like this?

// No loop
this.map.removeFeatureState({source: 'land'}, 'bench');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants