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

Add a reverse map for looking up metadata location indices. #1149

Merged
merged 1 commit into from
Apr 5, 2022

Conversation

otrho
Copy link
Contributor

@otrho otrho commented Apr 5, 2022

This improves performance a fair bit as it was doing an O(n) search for the location when creating any new span.

It reduces the time for me to run the E2E tests by about 30%, which is OK.

I don't see any obvious outliers in the profile any more but there are very likely some higher level algorithmic changes we could make, and identifying redundant work. I'm especially suspicious of the function construction the IR does when compiling a call, which will recreate every function called redundantly. It's very hard to avoid this at the moment though, since functions have no unique identifiers -- we need to enforce using full module callpaths. Right now they're still optional.

This improves performance a fair bit as it was doing an O(n) search for
the location when creating any new span.
@otrho otrho added code quality compiler: ir IRgen and sway-ir including optimization passes labels Apr 5, 2022
@otrho otrho self-assigned this Apr 5, 2022
@otrho
Copy link
Contributor Author

otrho commented Apr 5, 2022

I'm not super happy with adding the cache right there into the IR Context, but it's better than nothing.

Copy link
Contributor

@mohammadfawaz mohammadfawaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable.

@otrho otrho merged commit e70dbcc into master Apr 5, 2022
@otrho otrho deleted the otrho/ir_perf_improvements branch April 5, 2022 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality compiler: ir IRgen and sway-ir including optimization passes
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants