Skip to content

Commit c68b62b

Browse files
committed
perf(client-runtime): stop tracing streamed thread batches
1 parent e68e19d commit c68b62b

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
@@ -476,9 +476,8 @@ export const makeEnvironmentThreadState = Effect.fn("EnvironmentThreadState.make
476476
OrchestrationV2ThreadStreamItem,
477477
{ kind: "event" | "unknown-event" }
478478
>;
479-
const applyEventsLocked = Effect.fn("EnvironmentThreadState.applyEventsLocked")(function* (
480-
items: ReadonlyArray<SequencedItem>,
481-
) {
479+
// Per-batch streaming spans add trace volume without a useful timing boundary.
480+
const applyEventsLocked = Effect.fnUntraced(function* (items: ReadonlyArray<SequencedItem>) {
482481
const appliedSequence = yield* SubscriptionRef.get(lastSequence);
483482
let sequence = appliedSequence;
484483
const fresh: EventItem[] = [];
@@ -637,7 +636,8 @@ export const makeEnvironmentThreadState = Effect.fn("EnvironmentThreadState.make
637636
yield* applyEventsLocked([item]);
638637
});
639638

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

0 commit comments

Comments
 (0)