Skip to content

Resolve strict graph settings once per relation path - #542

Merged
lehni merged 1 commit into
mainfrom
refactor/strict-settings-cache
Oct 25, 2026
Merged

lehni merged 1 commit into
mainfrom
refactor/strict-settings-cache

Conversation

@lehni

@lehni lehni commented Oct 25, 2026

Copy link
Copy Markdown

Strict insertGraph() and upsertGraph() resolve their settings per node and option: getSetting() walks all relations entries with matchesRelationExpression() on every call. On a large upsert (~1,000 models, 22 relations entries) that's about 9,000 calls and 3–5 ms of 84 ms.

GraphOptions now resolves all settings of a relation path once and keeps them in a map, since the options don't change during a write. In that measurement, the upsert took 79 ms instead of 84 ms; small graphs show no difference. No behaviour change.

@lehni
lehni enabled auto-merge (squash) October 25, 2026 22:54
@lehni
lehni disabled auto-merge October 25, 2026 23:01
@lehni
lehni merged commit 45535d0 into main Oct 25, 2026
7 checks passed
@lehni
lehni deleted the refactor/strict-settings-cache branch October 25, 2026 23:01
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