Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/unreleased/related-features-memo.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- The runtime's memo of the features a feature's relationships name, per owner type (#1626), no longer records the features that declare no relationship of the kind asked for, which were most of its entries and grew with every type an instantiation touched. `FeaturesOf` over 7 000 types allocates 285 MB per run instead of 310 MB, and a cold `Instantiate` 230 MB instead of 252 MB, recovering most of what #1626 added over 0.11.0's 273 MB and 221 MB on the same toolchain; the memoized walks of the features that do relate stay memoized, so repeated reads still allocate nothing and `GRPCVerifyConstraint` is unchanged.
3 changes: 3 additions & 0 deletions internal/exec/runtime/subsetting.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ import (
// A declaration that itself restates sym (`:>> elements` on an object, walked past
// its library chain) masks nothing on that walk: the target stays the resolved one.
func (ctx *Context) relatedFeatures(sym, owner *symbols.Symbol, kind ast.RelationshipKind) []*symbols.Symbol {
if len(ctx.relationshipsOfKind(sym, kind)) == 0 {
return nil
}
key := relatedKey{sym, owner, kind}
if features, ok := ctx.model.related[key]; ok {
return features
Expand Down
Loading