Skip to content

Skip candidate buffering for classes whose trace visits nothing - #1743

Merged
ctate merged 1 commit into
mainfrom
ctate/skip-candidate-buffering-401c80
Oct 22, 2026
Merged

ctate merged 1 commit into
mainfrom
ctate/skip-candidate-buffering-401c80

Conversation

@ctate

@ctate ctate commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator
  • Instances of classes with no cycle-capable fields in a traced hierarchy start out SCR_CYC_ACYCLIC, so releases never buffer them and passes never take them as candidates.
  • On tsc-ts at --checkers 1, collector CPU drops from 1.92% to 1.52% on TypeORM (candidates −40%), and TypeORM check wall time drops 1.3%.
  • Publication and death paths treat the new value as unbuffered; bench:runtime is neutral.

A class carries the collector header when any class in its hierarchy can
be on a cycle, so instances of classes whose own fields hold nothing
cycle-capable were buffered as candidates and walked by every level. Such
an object has no traced children and is never on a cycle.

Their descriptors now name scr_cyc_no_children, and they are allocated
with buf set to SCR_CYC_ACYCLIC. That value has the buffered bit set, so
a release that leaves the object alive makes no call; scr_cyc_is_buffered
is false for it, and an emitted death or publication mark takes the object
out of a candidate buffer only when buf is below -1. A pass that walks
such an object as a child restores the value when it survives.
@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
scriptc Ready Ready Preview, v0 Oct 22, 2026 3:09am UTC

@ctate
ctate merged commit d0d1320 into main Oct 22, 2026
22 of 23 checks passed
@ctate
ctate deleted the ctate/skip-candidate-buffering-401c80 branch October 22, 2026 03:11

This branch was successfully deployed

1 active deployment
Preview — 4100cd3c Deployed Oct 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant