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

perf: Performance improvements to makeFullMesh function in MapLayer #1662 #1689

Merged
merged 22 commits into from
Oct 12, 2023

Conversation

nilscb
Copy link
Collaborator

@nilscb nilscb commented Oct 10, 2023

Optimizations done:

  • Ability to specify typed arrays as input (Float32Array).
  • Pre-allocate and use typed arrays in internal calculation of mesh.
  • Use same vertices for lines and triangles.
  • Only calculate lines and normals if specified.
  • Remove webworker.
  • Never copy input or change input data arrays.
  • Specify normals as signed bytes (int8) to save space.
  • General cleanup.

@nilscb nilscb added enhancement New feature or request AspenTech Task owned by AspenTech map-component Issues related to the map component. labels Oct 10, 2023
@nilscb nilscb self-assigned this Oct 10, 2023
@nilscb nilscb changed the title Map optimize performance: Performance improvements to makeFullMesh function in MapLayer #1662 Oct 10, 2023
@nilscb nilscb linked an issue Oct 10, 2023 that may be closed by this pull request
8 tasks
@nilscb nilscb changed the title performance: Performance improvements to makeFullMesh function in MapLayer #1662 perf: Performance improvements to makeFullMesh function in MapLayer #1662 Oct 10, 2023
@nilscb nilscb requested review from hkfb and w1nklr October 10, 2023 08:18
@w1nklr
Copy link
Collaborator

w1nklr commented Oct 10, 2023

I saw that you did some perf measures and that you removed the webworker.
What size of grid did you check (and what where the perfs) ?

@w1nklr
Copy link
Collaborator

w1nklr commented Oct 10, 2023

BTW, add a description to summarize the optimizations you apply in this PR

@nilscb
Copy link
Collaborator Author

nilscb commented Oct 10, 2023

In the story "BigMap" in webiz which is a map with 1452x1141 nodes the loading time went down from approximately 0.75 sec to 0.2 sec, I will investigate a bit the memory usage.

@nilscb
Copy link
Collaborator Author

nilscb commented Oct 10, 2023

I added a description of what has been done above.

@nilscb nilscb requested a review from hkfb October 11, 2023 12:50
 - use camelcase for names. Added comments to functions to explain behaviior.
return <SubsurfaceViewer {...subsurfaceViewerArgs} />;
};

export const TypedArrayInput: ComponentStory<typeof SubsurfaceViewer> = (
Copy link
Collaborator

@hkfb hkfb Oct 12, 2023

Choose a reason for hiding this comment

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

ComponentStory is deprecated in Storybook > v6.

You can resolve and merge if you like, but I think we should use the new format.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok I changed it to "StoryFn"

@nilscb nilscb merged commit f7a79cd into equinor:master Oct 12, 2023
5 checks passed
hkfb pushed a commit that referenced this pull request Oct 12, 2023
## [0.3.1](https://github.com/equinor/webviz-subsurface-components/compare/subsurface-viewer@0.3.0...subsurface-viewer@0.3.1) (2023-10-12)

### Performance Improvements

* Performance improvements to makeFullMesh function in MapLayer  [#1662](#1662) ([#1689](#1689)) ([f7a79cd](f7a79cd))
@hkfb
Copy link
Collaborator

hkfb commented Oct 12, 2023

🎉 This PR is included in version 0.3.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@hkfb hkfb added the released label Oct 12, 2023
@nilscb nilscb deleted the MapOptimize branch December 7, 2023 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AspenTech Task owned by AspenTech enhancement New feature or request map-component Issues related to the map component. released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance improvements to makeFullMesh function in MapLayer
3 participants