-
Notifications
You must be signed in to change notification settings - Fork 10
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
base: dev
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
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. |
|
||
namespace Speckle.Converters.Rhino.ToHost.Raw; | ||
|
||
public static class RhinoPools |
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.
Could you add here why this pools are introduced etc? for performance reasons, what was the problem that it fixed
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.
done
public Point3dList Convert(IReadOnlyList<double> target) | ||
public Point3dList Convert(IReadOnlyList<double> target) => new(ConvertToEnum(target)); | ||
|
||
public IEnumerable<RG.Point3d> ConvertToEnum(IReadOnlyList<double> target) |
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.
what is the benefit of convertin enum here? need more inline docs to remember later the reasoning
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.
It's avoiding temporary collections
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

After: 8.5 seconds
