Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improvement]: Reduce runtime type checker overhead #42000

Open
heshanpadmasiri opened this issue Jan 17, 2024 · 1 comment
Open

[Improvement]: Reduce runtime type checker overhead #42000

heshanpadmasiri opened this issue Jan 17, 2024 · 1 comment
Assignees
Labels
Area/RuntimeTypeChecker JBallerina runtime type checking related issues Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Improvement

Comments

@heshanpadmasiri
Copy link
Member

heshanpadmasiri commented Jan 17, 2024

Description

We have identified the fallowing optimization from nBallerina to be ported to jBallerina

  1. Caching type check results
  2. 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.

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

@heshanpadmasiri heshanpadmasiri added Type/Improvement Area/RuntimeTypeChecker JBallerina runtime type checking related issues labels Jan 17, 2024
@heshanpadmasiri heshanpadmasiri self-assigned this Jan 17, 2024
@ballerina-bot ballerina-bot added the Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime label Jan 17, 2024
@heshanpadmasiri heshanpadmasiri changed the title [Improvement]: Reduce runtime type checker performance [Improvement]: Reduce runtime type checker overhead Jan 17, 2024
@heshanpadmasiri heshanpadmasiri moved this from In Progress to On Hold in Ballerina Team Main Board Feb 6, 2024
@heshanpadmasiri
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/RuntimeTypeChecker JBallerina runtime type checking related issues Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Improvement
Projects
Status: On Hold
Development

Successfully merging a pull request may close this issue.

2 participants