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

avoid variables captured in closure from becoming boxed by passing them in as arguments. #30

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

KristofferC
Copy link
Contributor

@KristofferC KristofferC commented Jul 30, 2024

This is kind of sad...

code_warntype(Runic.spaces_in_listlike, Tuple{Runic.Context, Runic.Node})

showed that

require_trailing_comma::Core.Box
last_item_idx::Core.Box

and this poisoned a bunch of other values they touch to become ::Any.

For verifying the formatting of base/* in the julia repo:

Before:

    1.793848 seconds (42.09 M allocations: 1.342 GiB, 3.55% gc time)

After:

  1.576102 seconds (26.10 M allocations: 1.068 GiB, 3.58% gc time)

The times are kind of variable because it hits the filesystem quite a lot but it allocates around half at least.

@fredrikekre
Copy link
Owner

Thanks

@fredrikekre fredrikekre merged commit 21265f7 into fredrikekre:master Jul 30, 2024
14 checks passed
@KristofferC KristofferC deleted the kc/perf_1 branch July 30, 2024 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants