Skip to content

Avoid clearing caches in native toplevel #528

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

Merged
merged 1 commit into from
Feb 7, 2022

Conversation

stedolan
Copy link
Contributor

@stedolan stedolan commented Feb 7, 2022

Since #429, Emitaux clears various caches before calling the assembler, including the typechecker's cache of loaded cmi files.

When using ocamlopt to compile a single file, this saves memory. However, when using the native toplevel, this breaks short-paths (which relies on the cmi cache), and probably slows things down (because there are usually multiple phrases and the cache is useful). So, this patch turns off this mechanism when run from the toplevel.

(Future work: it may also be worth disabling this mechanism when ocamlopt is being used to compile multiple files)

Copy link
Contributor

@gretay-js gretay-js left a comment

Choose a reason for hiding this comment

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

Small comments that I have can be addressed separately.

@mshinwell mshinwell merged commit 8751d85 into oxcaml:main Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants