-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
The runSubscribersWithMutation function has a critical performance bottleneck causing long execution time with the potential to hang the browser completely.
Impact
- The example dojo app has 26 active subscribers during streaming
- Message arrays grow from 0 to 42 messages during a 742KB test run with ~200 events
- Current execution time: 810ms
| Traffic | Events | Trace |
|---|---|---|
![]() |
![]() |
![]() |
Root Cause
This is in the hot path, called 2Γ per streaming event (once for onEvent, once for specific event handler), but it:
- Clones per subscriber even if they do not mutate
- Does expensive change detection via
JSON.stringify()
Proposed Solution
I have a working fix on my fork with two commits:
- Move cloning from inputs to outputs scoutqa-dot-ai@27b7ab2
- Use reference equality to identify changes scoutqa-dot-ai@bdb380e
Expected Results
- New execution time: ~53ms (15x faster)
- Eliminate serialization bottleneck visible in flame graphs
I'm ready to submit a PR once this approach is validated.
hundong2 and fhydraliskfhydralisk
Metadata
Metadata
Assignees
Labels
No labels


