Skip to content

Commit

Permalink
perf: better cache key for parsing exports
Browse files Browse the repository at this point in the history
  • Loading branch information
gabotechs committed Dec 25, 2023
1 parent 7ad94f8 commit e6c1e05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/language/exports.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (p *Parser[F]) parseExports(
return ctx, nil, errors.New("circular export: " + err.Error())
}
defer stack.Pop()
unwrappedCacheKey := parseExportsKey(fmt.Sprintf("%s-%t", stack.Hash(), unwrappedExports))
unwrappedCacheKey := parseExportsKey(fmt.Sprintf("%s-%t", id, unwrappedExports))
if cached, ok := ctx.Value(unwrappedCacheKey).(*ExportsResult); ok {
return ctx, cached, nil
}
Expand Down

0 comments on commit e6c1e05

Please sign in to comment.