Skip to content

Rebase #210#265

Merged
rgrinberg merged 3 commits intomasterfrom
perf-rebase
Apr 18, 2024
Merged

Rebase #210#265
rgrinberg merged 3 commits intomasterfrom
perf-rebase

Conversation

@rgrinberg
Copy link
Copy Markdown
Member

A very nice performance improvement

When executing [let st = st.next.[...]], the initial [st] is still live,
so the compiler cannot reuse the register for the new value of [st] and
a move instruction will have to be performed. As a hack, we add another
parameter to the loop functions that contains the same value as the
initial [st] and can be used afterwards. We still have a move to set
this parameter, but it is no longer on the critical path.
We replace [let st = st.next.[...]] by [let st = st.[...]]. This removes
one memory access on the critical path, making it twice shorter. But we now
have to use [Obj.magic] to get information about the current state...
Now that the critical path is much shorter, the bottleneck becomes the
number of instructions executed by loop iteration: bound checks are no
longer "for free".
@rgrinberg rgrinberg merged commit e1fe232 into master Apr 18, 2024
@rgrinberg rgrinberg deleted the perf-rebase branch April 18, 2024 22:05
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