-
Notifications
You must be signed in to change notification settings - Fork 6
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
[WIP] Fix startup speed #60
base: master
Are you sure you want to change the base?
Conversation
According to some very unscientific testing, current change cuts speed (and allocations) down by a factor of around 2. Still a couple of seconds on a fast machine to run cc: @MasonProtter |
Exciting! |
From what I understood, #38 was meant to be about the speed of initially creating the rule set (by calling |
Oh I see, I didn’t realize calling |
julia> using Rewrite
julia> @time rules();
2.365382 seconds (3.59 M allocations: 179.190 MiB, 3.12% gc time)
julia> @time rules();
0.017669 seconds (21.51 k allocations: 1007.078 KiB) Seems like it has to be. 😅 It's probably worth it long-term to rethink how rules are actually stored (and how to cache them effectively), since currently we call |
Oh no, there's more! julia> t = @term(1 - 2/2);
rs = rules();
julia> @time normalize(t, rs)
7.992327 seconds (10.88 M allocations: 547.837 MiB, 3.24% gc time)
@term(0)
julia> @time normalize(t, rs)
0.015746 seconds (79.30 k allocations: 7.676 MiB, 43.38% gc time)
@term(0) Probably related to #62. |
Resolve merge conflicts in fix/speed and bring it up to date with Master
It seems like matching might be the culprit - in hindsight, this makes sense, considering how often it's called and how expensive some of the operations involved are. Currently working to optimize it. |
I've opened #67 separately, since it seems disjoint from these improvements. |
Re: #38.