Skip to content

Speed up Rhino transformation conversions - #1530

Open
gonzalocasas wants to merge 1 commit into
mainfrom
faster-transformation-to-rhino
Open

Speed up Rhino transformation conversions#1530
gonzalocasas wants to merge 1 commit into
mainfrom
faster-transformation-to-rhino

Conversation

@gonzalocasas

@gonzalocasas gonzalocasas commented Aug 28, 2026

Copy link
Copy Markdown
Member

Easy win ("low hanging fruit" in corporate-speak): the rhino indexer for Transform is fucking slow. Doing the same thing with direct assignment to the .M## fields is significantly faster (saves a bunch of boxing ops probably). Here's the mandatory profiling summary to confirm the improvement (ran on 10k iterations, with 2k warm up)

case                                         same T   random T    paired   calls/ms   speedup
                                            us/call    us/call     delta   (random)  (random)
---------------------------------------------------------------------------------------------
legacy transformation_to_rhino               26.622     25.178      5.6%       39.7     -
legacy transformation_matrix_to_rhino        23.723     23.353      2.6%       42.8     -
transformation_to_rhino                       2.405      2.398      6.1%      417.0    10.50x
transformation_matrix_to_rhino                2.334      2.334      0.3%      428.4    10.79x

What type of change is this?

  • Bug fix in a backwards-compatible manner.
  • New feature in a backwards-compatible manner.
  • Breaking change: bug fix or new feature that involve incompatible API changes.
  • Other (e.g. doc update, configuration, etc)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I added a line to the CHANGELOG.md file in the Unreleased section under the most fitting heading (e.g. Added, Changed, Removed).
  • I ran all tests on my computer and it's all green (i.e. invoke test).
  • I ran lint on my computer and there are no errors (i.e. invoke lint).
  • I added new functions/classes and made them available on a second-level import, e.g. compas.datastructures.Mesh.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate)

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.38%. Comparing base (5fc43fe) to head (a98741e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1530      +/-   ##
==========================================
- Coverage   62.40%   62.38%   -0.02%     
==========================================
  Files         208      208              
  Lines       22487    22487              
==========================================
- Hits        14032    14028       -4     
- Misses       8455     8459       +4     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gonzalocasas gonzalocasas changed the title Speed up Rhino transformation conversions ~11x Speed up Rhino transformation conversions Aug 28, 2026
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.

1 participant