Remove message boxing for performance improvement#387
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #387 +/- ##
==========================================
+ Coverage 85.99% 86.35% +0.35%
==========================================
Files 73 71 -2
Lines 13564 13517 -47
==========================================
+ Hits 11665 11673 +8
+ Misses 1899 1844 -55 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8dd6003 to
0ac9bc9
Compare
Performance tests
Main branchExcluding the output port tests (because they take forever and should be isolated anyways, which this PR does properly) this branch |
|
Added a new benchmark for message sending to assess if sending (but not receiving) messages is improved with this change. This branchmainPatching this benchmark suite on main and running there yields: |
0ac9bc9 to
551451b
Compare
This resolves conflicts between the main branch (with thread-local supervision fixes and version bumps) and PR #387 which refactors message handling to remove boxing complexity for better performance.
After merging PR #387 which removed message boxing, the send_message method in ActorRef needs to call send_message directly instead of the removed send_message_unchecked method.
7b08703 to
20f4c26
Compare
Benchmark Comparison (PR vs
|
|
Claude's new perf analysis |
b1b1494 to
933fd62
Compare
This is an extension of the message boxing approach proposed in PR #370. This however continues the improvements to remove additional type information that isn't necessary. This diff includes the removal of the BoxedMessage struct in favor of a crate-private RactorMessage trait which adds the necessary extension methods, only within the `ractor` context so as the privatize that functionality, as it was an unintentional leak anyways. This of course is a semver break as a public type is going away, but it should have been unused anyways in all contexts. Additionally `BoxedDowncastErr` is renamed to `DowncastErr` as we are no longer boxing the message, but again this error variant shouldn't really be used publicly. Will re-run the performance benchmarks present in #370 and past as a PR comment once ready
This is an extension of the message boxing approach proposed in PR #370. This however continues the improvements to remove additional type information that isn't necessary.
This diff includes the removal of the BoxedMessage struct in favor of a crate-private RactorMessage trait which adds the necessary extension methods, only within the
ractorcontext so as the privatize that functionality, as it was an unintentional leak anyways. This of course is a semver break as a public type is going away, but it should have been unused
anyways in all contexts. Additionally
BoxedDowncastErris renamed toDowncastErras we are no longer boxing the message, but again this error variant shouldn't really be used publicly.Will re-run the performance benchmarks present in #370 and past as a PR comment once ready