Skip to content

Speed up the output plugin - #299

Merged
jdesrosiers merged 4 commits into
mainfrom
output-plugin-performance
Oct 22, 2026
Merged

jdesrosiers merged 4 commits into
mainfrom
output-plugin-performance

Conversation

@jdesrosiers

Copy link
Copy Markdown
Collaborator

Validating a valid 150KB GitHub workflow against its schema with JSE output went from about 44ms to 7ms. An invalid one now takes about 24ms.

  • Compute each output location's URI once. The instance location's URI was built three times for every keyword, and each build encodes the pointer. (44ms → 30ms)
  • Build output records without hidden classes. Records are keyed by locations and URIs, so nearly every new key gave a plain object a new hidden class. Prototype-less records start in dictionary mode instead. (30ms → 26ms)
  • Compute the instance location's URI once per schema. All of a schema's keywords share an instance location, so its URI is now built when the schema is entered rather than after every keyword. (26ms → 22ms)
  • Build the normalized output only when it's asked for. The output is only needed when there are errors, but it was built during every evaluation. The plugin now records what each schema's keywords did and builds the output lazily. (21ms → 7ms valid; 23ms → 24ms invalid, since the output is now built after evaluation)

🤖 Generated with Claude Code

jdesrosiers and others added 4 commits October 20, 2026 22:32
The output plugin built the instance location's URI three times for
every keyword, and building it encodes the pointer. Validating a 150KB
GitHub workflow against its schema with JSE output went from about 44ms
to 30ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Output records are keyed by instance locations, keyword URIs and schema
locations, so nearly every key added to a plain object gave it a new
hidden class. Records without a prototype start in dictionary mode
instead. Validating a 150KB GitHub workflow against its schema with JSE
output went from about 30ms to 26ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All of a schema's keywords apply to the same instance location, but its
URI was built after every keyword. It's now built when the schema is
entered. Validating a 150KB GitHub workflow against its schema with JSE
output went from about 26ms to 22ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The output is only used when there are errors, but it was built during
every evaluation. The plugin now records what each schema's keywords
did and builds the normalized output from that when it's first asked
for. Validating a valid 150KB GitHub workflow against its schema with
JSE output went from about 21ms to 7ms. An invalid one went from about
23ms to 24ms because the output is built after evaluation instead of
during it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jdesrosiers
jdesrosiers merged commit b7c2346 into main Oct 22, 2026
2 checks passed
@jdesrosiers
jdesrosiers deleted the output-plugin-performance branch October 22, 2026 02:31
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