Repository navigation
Conversation
`isVisible` and `isPopulated` scanned the whole `fields`/`populate` list for every property of every entity, and child options were rebuilt for each relation of each entity. With a `fields` whitelist that cost grows with properties times fields. `serialize()` now copies the caller options once per call, so the first-segment lookups and the derived child options are cached for every entity of that call. The caller's options are no longer mutated (`populate` used to be normalized to an array in place). Serializing 500 entities with a 40-path `fields` whitelist: 15.1 -> 12.3 ms median. Populate-only and narrow `fields` are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8464 +/- ##
==========================================
- Coverage 99.66% 99.65% -0.01%
==========================================
Files 293 293
Lines 32172 32206 +34
Branches 9268 9275 +7
==========================================
+ Hits 32065 32096 +31
- Misses 103 106 +3
Partials 4 4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
isVisibleandisPopulatedscanned the wholefields/populatelist for every property of every entity, and child options were rebuilt for each relation of each entity. With afieldswhitelist that cost grows with properties times fields.serialize()now copies the caller options once per call, so the first-segment lookups and the derived child options are cached for every entity of that call. The caller's options are no longer mutated (populateused to be normalized to an array in place).Serializing 500 entities with a 40-path
fieldswhitelist: 15.1 -> 12.3 ms median. Populate-only and narrowfieldsare unchanged.