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 H3HexagonLayer perf #3103

Merged
merged 2 commits into from May 16, 2019
Merged

Improve H3HexagonLayer perf #3103

merged 2 commits into from May 16, 2019

Conversation

Pessimistress
Copy link
Collaborator

Background

The current implementation of H3HexagonLayer updates the instanced geometry (regenerating attributes and creating new WebGL buffers) whenever the hexagon at the center of the viewport changes. This is excessive especially at fine resolutions.

This PR introduces a distance threshold within which we consider all hexagons having the same shape. This significantly reduces the number of attribute updates needed when interacting with the viewport.

Change List

  • Use the distance between the current center hex and the last center hex to determine whether geometry update is needed

@coveralls
Copy link

coveralls commented May 16, 2019

Coverage Status

Coverage increased (+0.009%) to 62.019% when pulling a177366 on x/h3-hexagon-perf into 0f25034 on master.

Copy link
Contributor

@nrabinowitz nrabinowitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, added two small suggestions.

modules/geo-layers/src/h3-layers/h3-hexagon-layer.js Outdated Show resolved Hide resolved
modules/geo-layers/src/h3-layers/h3-hexagon-layer.js Outdated Show resolved Hide resolved
@Pessimistress Pessimistress changed the base branch from x/column-layer-stroke to master May 16, 2019 22:28
@Pessimistress Pessimistress merged commit 63837b6 into master May 16, 2019
@Pessimistress Pessimistress deleted the x/h3-hexagon-perf branch May 16, 2019 22:49
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