Skip to content

Conversation

@domenic
Copy link
Member

@domenic domenic commented Jan 9, 2026

The cache key was not including the inArray parameter, which meant that cache entries would be incorrectly reused between calls with different inArray values, causing unnecessary re-parsing.

Since almost all callers use inArray: true, adding it to the cache key significantly improves cache hit rates and overall performance.

🤖 Generated with Claude Code


To-do before merging:

  • Human code review (@asamuzaK welcome to help)
  • Double-check benchmark improvements manually
  • Double-check the full jsdom test suite passes

The cache key was not including the inArray parameter, which meant that
cache entries would be incorrectly reused between calls with different
inArray values, causing unnecessary re-parsing.

Since almost all callers use inArray: true, adding it to the cache key
significantly improves cache hit rates and overall performance.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@domenic
Copy link
Member Author

domenic commented Jan 9, 2026

Claude tried to do https://github.com/jsdom/cssstyle/compare/perf/consistent-inarray separately but I think it should be merged with this one. Or maybe we can eliminate isArray? Need to investigate a bit more.

@domenic
Copy link
Member Author

domenic commented Jan 9, 2026

See #290

@domenic domenic closed this Jan 9, 2026
@domenic domenic deleted the perf/cache-key-fix branch January 10, 2026 02:19
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.

2 participants