switch to js implementation of orchestrion#6877
Merged
Conversation
Contributor
Overall package sizeSelf size: 3.59 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 1.15.0 | 127.66 kB | 856.24 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #6877 +/- ##
==========================================
- Coverage 84.83% 84.77% -0.07%
==========================================
Files 515 521 +6
Lines 22022 22149 +127
==========================================
+ Hits 18683 18776 +93
- Misses 3339 3373 +34 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This comment has been minimized.
This comment has been minimized.
420e1be to
5461ae1
Compare
5461ae1 to
7a516d9
Compare
bengl
previously approved these changes
Dec 8, 2025
4ce3454 to
f53b8fa
Compare
bengl
previously approved these changes
Dec 9, 2025
8dd9c31 to
47e5adb
Compare
bengl
approved these changes
Dec 12, 2025
Merged
BridgeAR
pushed a commit
that referenced
this pull request
Dec 17, 2025
nina9753
pushed a commit
that referenced
this pull request
Dec 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Switch to JavaScript implementation of Orchestrion.
Motivation
In its current form, Orchestrion is too heavy to be usable for instrumentation. It also lacks a good query engine to be powerful enough for any transformations, and it requires 2 distinct Rust projects to be updated and released every time we need to make any change. While this is still the direction we want to be going long-term, I don't see a path forward short-term so I wrote a JS version that enables our integrations team to start using the rewriter approach.
Startup time impact goes from +46-104% with Orchestrion to +6-11% with the JS based rewriter. Of course lazy loading can help with these numbers in both cases, but that's only true when no instrumentation is done using the rewriter, which will be less and less common as we start adding and updating integrations.
Instrumentation time is a bit slower but since we don't instrument a lot of files that's fine, especially since the time to parse is relative to the size of the file, and larger files are also slower to load for Node and v8, so parsing is only slow for an already slow to load file. For example, parsing langchain goes from 7ms to 14ms, but the library itself takes 100ms+ to load so we're still pretty insignificant in comparison.
Additional Notes
The goal of this PR is not to replace Orchestrion, quite the opposite. The JS implementation simply enables us to ship this now without having to make the many changes that are needed to get Orchestrion work for our needs. This is especially true since some of our needs are not known yet and may require larger changes. Once our usage becomes stable, everything should be backported to Orchestrion and we should switch back.