We have identified the fallowing optimization from nBallerina to be ported to jBallerina
Caching type check results
Introducing simple type tags
1 should improve performance in cases such as foreach loops over lists where we repeated do the type check for the same type pair (since list iterator is implemented using java interop)
Under 2 each type/value in runtime will have a pair of bit sets (most likely implemented directly as long), all representing each basic type it cover entirely and some representing each basic type it cover partially. We should be able to use these to efficiently prune away easy type checks.
With #42111 we are now caching common repeated type calculations. Since we are reworking the runtime type checker under #40511 we'll revisit this after that change
Description
We have identified the fallowing optimization from nBallerina to be ported to jBallerina
1 should improve performance in cases such as
foreach
loops over lists where we repeated do the type check for the same type pair (since list iterator is implemented using java interop)Under 2 each type/value in runtime will have a pair of bit sets (most likely implemented directly as
long
),all
representing each basic type it cover entirely andsome
representing each basic type it cover partially. We should be able to use these to efficiently prune away easy type checks.Describe your problem(s)
No response
Describe your solution(s)
No response
Related area
-> Runtime
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response