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

Sped up Rhino receive hot spots #596

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open

Conversation

adamhathcock
Copy link
Member

Found a couple of hot spots in Rhino receive mostly around Mesh conversions. Avoid making intermediate structs and pool objects where it makes sense with the API

Conversion total before: 15 secs
image

After: 8.5 seconds
image

Copy link

codecov bot commented Feb 18, 2025

Codecov Report

Attention: Patch coverage is 0% with 32 lines in your changes missing coverage. Please review.

Project coverage is 8.75%. Comparing base (8f72eb3) to head (c711def).

Files with missing lines Patch % Lines
...ters.RhinoShared/ToHost/Raw/MeshToHostConverter.cs 0.00% 28 Missing ⚠️
...oShared/ToHost/Raw/FlatPointListToHostConverter.cs 0.00% 2 Missing ⚠️
...le.Converters.RhinoShared/ToHost/Raw/RhinoPools.cs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             dev    #596      +/-   ##
========================================
- Coverage   8.76%   8.75%   -0.01%     
========================================
  Files        227     228       +1     
  Lines       4346    4350       +4     
  Branches     546     548       +2     
========================================
  Hits         381     381              
- Misses      3950    3954       +4     
  Partials      15      15              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@adamhathcock adamhathcock enabled auto-merge (squash) February 19, 2025 08:45

namespace Speckle.Converters.Rhino.ToHost.Raw;

public static class RhinoPools
Copy link
Member

Choose a reason for hiding this comment

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

Could you add here why this pools are introduced etc? for performance reasons, what was the problem that it fixed

Copy link
Member Author

Choose a reason for hiding this comment

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

done

public Point3dList Convert(IReadOnlyList<double> target)
public Point3dList Convert(IReadOnlyList<double> target) => new(ConvertToEnum(target));

public IEnumerable<RG.Point3d> ConvertToEnum(IReadOnlyList<double> target)
Copy link
Member

Choose a reason for hiding this comment

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

what is the benefit of convertin enum here? need more inline docs to remember later the reasoning

Copy link
Member Author

Choose a reason for hiding this comment

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

It's avoiding temporary collections

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.

4 participants