Skip to content

Commit 66e96e5

Browse files
authored
perf(client-runtime): stop tracing streamed thread batches (pingdotgg#30679)
1 parent 7057a74 commit 66e96e5

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎packages/client-runtime/src/state/threads.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -501,9 +501,8 @@ export const makeEnvironmentThreadState = Effect.fn("EnvironmentThreadState.make
501501
OrchestrationV2ThreadStreamItem,
502502
{ kind: "event" | "unknown-event" }
503503
>;
504-
const applyEventsLocked = Effect.fn("EnvironmentThreadState.applyEventsLocked")(function* (
505-
items: ReadonlyArray<SequencedItem>,
506-
) {
504+
// Per-batch streaming spans add trace volume without a useful timing boundary.
505+
const applyEventsLocked = Effect.fnUntraced(function* (items: ReadonlyArray<SequencedItem>) {
507506
const appliedSequence = yield* SubscriptionRef.get(lastSequence);
508507
let sequence = appliedSequence;
509508
const fresh: EventItem[] = [];
@@ -662,7 +661,8 @@ export const makeEnvironmentThreadState = Effect.fn("EnvironmentThreadState.make
662661
yield* applyEventsLocked([item]);
663662
});
664663

665-
const applyItems = Effect.fn("EnvironmentThreadState.applyItems")(function* (
664+
// Keep this per-batch streaming path untraced for the same reason as applyEventsLocked.
665+
const applyItems = Effect.fnUntraced(function* (
666666
items: ReadonlyArray<OrchestrationV2ThreadStreamItem>,
667667
) {
668668
yield* applyLock.withPermits(1)(

0 commit comments

Comments
 (0)