Skip to content

Avoid clearing caches in native toplevel#528

Merged
mshinwell merged 1 commit intooxcaml:mainfrom
stedolan:no-cache-clear-opttop
Feb 7, 2022
Merged

Avoid clearing caches in native toplevel#528
mshinwell merged 1 commit intooxcaml:mainfrom
stedolan:no-cache-clear-opttop

Conversation

@stedolan
Copy link
Copy Markdown
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
Copy Markdown
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