Skip to content

perf: reuse flattened anyOf and oneOf alternatives - #300

Open
Kaileshwar16 wants to merge 1 commit into
hyperjump-io:mainfrom
Kaileshwar16:perf/295-alternative-flattening
Open

Kaileshwar16 wants to merge 1 commit into
hyperjump-io:mainfrom
Kaileshwar16:perf/295-alternative-flattening

Conversation

@Kaileshwar16

Copy link
Copy Markdown
Contributor

Refs #295.

Ihave reused the flattened alternative results across filtering, validity checks, and error generation

The change is kept small:

Performance and validation:

  • The large generated oneOf case improved by roughly 5 to 8%.
  • All 1406 tests pass.
  • Lint and type checks pass.

Tradeoffs:

The change adds a little helper indirection and potentially more temporary memory during multiple-match handling. Smaller cases showed no consistent performance improvement or regression, while the larger nested case improved by roughly 5–8%. so this isn't a general speedup. I haven't measured the memory impact yet.

your thoughts on whether the gain is worth those tradeoffs

This branch has not been deployed

No deployments
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