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

Restore already scanned optimisation #13574

Open
kayceesrk opened this issue Oct 28, 2024 · 1 comment · May be fixed by #13594
Open

Restore already scanned optimisation #13574

kayceesrk opened this issue Oct 28, 2024 · 1 comment · May be fixed by #13594

Comments

@kayceesrk
Copy link
Contributor

kayceesrk commented Oct 28, 2024

OCaml 4 has "Already Scanned" optimisation to avoid rescanning stack frames that haven't changed. See

#ifdef Already_scanned
. This feature was not implemented in OCaml 5 only because initially OCaml 5 only ran on x86, where this feature was not available. There are no blockers to this feature being re-enabled.

In OCaml 5, since the runtime maintains the stacks, the stack limits are generous: #11238. Hence, the already scanned optimisation is much more useful than in OCaml 5 than in OCaml 4. So much so that it may be worth coming with a scheme to enable this feature in all the architectures and not just in those where bits can be stolen return addresses. One possibility is to have an extra word in every frame for the already scanned information. Since only a single bit is necessary for the already scanned information, the rest of the bits may be used for other purposes.

CC @stedolan and @jasigal, who has some OCaml programs that may benefit from this optimisation.

@gasche
Copy link
Member

gasche commented Oct 28, 2024

We had some discussion of this in #11923 , which is still fairly relevant.

@xavierleroy xavierleroy linked a pull request Nov 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants