Repository navigation
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
e30e4c2 to
55b4335
Compare
ChildEnv.get was one match of 59 instanceof tests. Most nodes bind nothing, so they failed every test before reaching the default. The env walkers call get once per child, and in a profile of TypeCheck on a 1000-field MakeStruct it took about 7% of samples. get now dispatches on the tag the way TypeCheck does. It switches on the node's family and calls one method per family, which switches on the tag. Families with no binders (Const, Struct, IO and Random) return e from the first switch. All ten switches compile to a tableswitch, and the largest method, getStream, is 538 bytes. Table, Matrix and BlockMatrix mix relational nodes, whose children get e.fresh, with value nodes such as TableCount, whose children get e. Each of those methods lists its value nodes, the shorter list, and sends the rest to e.fresh. Every node gets the same env as before. In IRPassBenchmark, against the previous commit over 3 forks, TypeCheck is 4 to 8% faster, NormalizeNames 3 to 6% faster, and ForwardLets 6% faster on wide and 16% on tree. A second run with the base first gave 17% on ForwardLets tree. Allocation does not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
55b4335 to
417e48b
Compare
Stack 11. Based on #15934.
Why
ChildEnv.getwas onematchof 59instanceoftests. Most nodes (Ref,GetField,MakeStruct) bind nothing, so they failed every test before reachingcase _ => e. The envwalkers call
getonce per child, and in a profile ofTypeCheckon a 1000-fieldMakeStructit took about 7% of samples.
Summary
Table, Matrix and BlockMatrix mix relational nodes, whose children get
e.fresh, with valuenodes, whose children get
e. Each of those methods lists its value nodes, the shorter list,and sends the rest to
e.fresh. Every node gets the same env as before.e.fresheAll ten switches compile to a
tableswitch. The largest method,getStream, is 538 bytes.Benchmarks
IRPassBenchmark, 3 forks each, against #15934. Times in µs.A second
forwardLetsrun ontree, with the base first, gave −17%. Allocation does notchange. The
deepresults fortypeCheckandnormalizeNamesare within fork-to-fork noise.🤖 Generated with Claude Code