-
Notifications
You must be signed in to change notification settings - Fork 233
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
Configurable cache retention period #1698
Conversation
Is that PR ready for review ? Looks like everything is in place :-) Maybe we could write a test which show cache hits when the flag has a very high value and no cache hit when it is set to 0. |
@voodoos I was considering extending vim and emacs plugins, so that they can use this new flag. But this PR is actually nice and self-contained, so I'll just write tests and ask you for review when ready :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. The test is very nice :-)
Remove old call to `flush_caches` Add `-cache-time` flag Add tests for `--cache-time` flag Add changelog entry for ocaml#1698 Change cache time measure to minutes. Fix quoting.t Fix cache-time.t tests Replace awk with sed in cache-time.t debug logs Fix grep pattern Investigate logs Flush file_cache logs Investigate logs Move test file Add
@voodoos , I've added emacs handling, because it was super simple. Here is logged result of using it (as a proof that it actually works). It's a simple query ran on merlin codebase:
|
Perfect ! Thank you ! |
from 3Rafal/cache-flush
CHANGES: Fri Dec 1 15:00:42 CET 2023 + merlin binary - Fix a follow-up issue to the preference of non-ghost nodes introduced in ocaml/merlin#1660 (ocaml/merlin#1690, fixes ocaml/merlin#1689) - Add `-cache-lifespan` flag, that sets cache invalidation period. (ocaml/merlin#1698, ocaml/merlin#1705) - Fix Merlin locate not fallbacking on the correct file in case of ambiguity (@goldfirere, ocaml/merlin#1699) - Fix Merlin reporting errors provoked by the recovery itself (ocaml/merlin#1709, fixes ocaml/merlin#1704) + editor modes - vim: load merlin when Vim is compiled with +python3/dyn (e.g. MacVim) - emacs: highlight only first error line by default (ocaml/merlin#1693, fixes ocaml/merlin#1663)
CHANGES: Fri Dec 1 15:00:42 CET 2023 + merlin binary - Fix a follow-up issue to the preference of non-ghost nodes introduced in ocaml/merlin#1660 (ocaml/merlin#1690, fixes ocaml/merlin#1689) - Add `-cache-lifespan` flag, that sets cache invalidation period. (ocaml/merlin#1698, ocaml/merlin#1705) - Ignore the new 5.1 `cmi-file` flag instead of rejecting it (ocaml/merlin#1710, fixes ocaml/merlin#1703) - Fix Merlin locate not fallbacking on the correct file in case of ambiguity (@goldfirere, ocaml/merlin#1699) - Fix Merlin reporting errors provoked by the recovery itself (ocaml/merlin#1709, fixes ocaml/merlin#1704) + editor modes - vim: load merlin when Vim is compiled with +python3/dyn (e.g. MacVim) - emacs: highlight only first error line by default (ocaml/merlin#1693, fixes ocaml/merlin#1663)
CHANGES: Fri Dec 1 15:00:42 CET 2023 + merlin binary - Fix a follow-up issue to the preference of non-ghost nodes introduced in ocaml/merlin#1660 (ocaml/merlin#1690, fixes ocaml/merlin#1689) - Add `-cache-lifespan` flag, that sets cache invalidation period. (ocaml/merlin#1698, ocaml/merlin#1705) - Ignore the new 5.1 `cmi-file` flag instead of rejecting it (ocaml/merlin#1710, fixes ocaml/merlin#1703) - Fix Merlin locate not fallbacking on the correct file in case of ambiguity (@goldfirere, ocaml/merlin#1699) - Fix Merlin reporting errors provoked by the recovery itself (ocaml/merlin#1709, fixes ocaml/merlin#1704) - Add support for OCaml 5.1.1 (ocaml/merlin#1714) + editor modes - vim: load merlin when Vim is compiled with +python3/dyn (e.g. MacVim) - emacs: highlight only first error line by default (ocaml/merlin#1693, fixes ocaml/merlin#1663)
CHANGES: Fri Dec 1 15:00:42 CET 2023 + merlin binary - Fix a follow-up issue to the preference of non-ghost nodes introduced in ocaml/merlin#1660 (ocaml/merlin#1690, fixes ocaml/merlin#1689) - Add `-cache-lifespan` flag, that sets cache invalidation period. (ocaml/merlin#1698, ocaml/merlin#1705) - Ignore the new 5.1 `cmi-file` flag instead of rejecting it (ocaml/merlin#1710, fixes ocaml/merlin#1703) - Fix Merlin locate not fallbacking on the correct file in case of ambiguity (@goldfirere, ocaml/merlin#1699) - Fix Merlin reporting errors provoked by the recovery itself (ocaml/merlin#1709, fixes ocaml/merlin#1704) - Add support for OCaml 5.1.1 (ocaml/merlin#1714) + editor modes - vim: load merlin when Vim is compiled with +python3/dyn (e.g. MacVim) - emacs: highlight only first error line by default (ocaml/merlin#1693, fixes ocaml/merlin#1663) [new release] merlin-lib and merlin (4.13-501) CHANGES: Fri Dec 1 15:00:42 CET 2023 + merlin binary - Fix a follow-up issue to the preference of non-ghost nodes introduced in ocaml/merlin#1660 (ocaml/merlin#1690, fixes ocaml/merlin#1689) - Add `-cache-lifespan` flag, that sets cache invalidation period. (ocaml/merlin#1698, ocaml/merlin#1705) - Ignore the new 5.1 `cmi-file` flag instead of rejecting it (ocaml/merlin#1710, fixes ocaml/merlin#1703) - Fix Merlin locate not fallbacking on the correct file in case of ambiguity (@goldfirere, ocaml/merlin#1699) - Fix Merlin reporting errors provoked by the recovery itself (ocaml/merlin#1709, fixes ocaml/merlin#1704) + editor modes - vim: load merlin when Vim is compiled with +python3/dyn (e.g. MacVim) - emacs: highlight only first error line by default (ocaml/merlin#1693, fixes ocaml/merlin#1663) [new release] merlin-lib and merlin (4.13-414) CHANGES: Fri Dec 1 15:00:42 CET 2023 + merlin binary - Fix a follow-up issue to the preference of non-ghost nodes introduced in ocaml/merlin#1660 (ocaml/merlin#1690, fixes ocaml/merlin#1689) - Add `-cache-lifespan` flag, that sets cache invalidation period. (ocaml/merlin#1698, ocaml/merlin#1705) - Fix Merlin locate not fallbacking on the correct file in case of ambiguity (@goldfirere, ocaml/merlin#1699) - Fix Merlin reporting errors provoked by the recovery itself (ocaml/merlin#1709, fixes ocaml/merlin#1704) + editor modes - vim: load merlin when Vim is compiled with +python3/dyn (e.g. MacVim) - emacs: highlight only first error line by default (ocaml/merlin#1693, fixes ocaml/merlin#1663)
CHANGES: Mon Dec 18 16:42:00 CET 2023 + merlin binary - Fix a follow-up issue to the preference of non-ghost nodes introduced in ocaml/merlin#1660 (ocaml/merlin#1690, fixes ocaml/merlin#1689) - Add `-cache-lifespan` flag, that sets cache invalidation period. (ocaml/merlin#1698, ocaml/merlin#1705) - Fix Merlin locate not fallbacking on the correct file in case of ambiguity (@goldfirere, ocaml/merlin#1699) - Fix Merlin reporting errors provoked by the recovery itself (ocaml/merlin#1709, fixes ocaml/merlin#1704) + editor modes - vim: load merlin when Vim is compiled with +python3/dyn (e.g. MacVim) - emacs: highlight only first error line by default (ocaml/merlin#1693, fixes ocaml/merlin#1663)
CHANGES: Mon Dec 18 16:42:00 CET 2023 + merlin binary - Fix a follow-up issue to the preference of non-ghost nodes introduced in ocaml/merlin#1660 (ocaml/merlin#1690, fixes ocaml/merlin#1689) - Add `-cache-lifespan` flag, that sets cache invalidation period. (ocaml/merlin#1698, ocaml/merlin#1705) - Fix Merlin locate not fallbacking on the correct file in case of ambiguity (@goldfirere, ocaml/merlin#1699) - Fix Merlin reporting errors provoked by the recovery itself (ocaml/merlin#1709, fixes ocaml/merlin#1704) + editor modes - vim: load merlin when Vim is compiled with +python3/dyn (e.g. MacVim) - emacs: highlight only first error line by default (ocaml/merlin#1693, fixes ocaml/merlin#1663)
CHANGES: Fri Dec 1 15:00:42 CET 2023 + merlin binary - Fix a follow-up issue to the preference of non-ghost nodes introduced in ocaml/merlin#1660 (ocaml/merlin#1690, fixes ocaml/merlin#1689) - Add `-cache-lifespan` flag, that sets cache invalidation period. (ocaml/merlin#1698, ocaml/merlin#1705) - Ignore the new 5.1 `cmi-file` flag instead of rejecting it (ocaml/merlin#1710, fixes ocaml/merlin#1703) - Fix Merlin locate not fallbacking on the correct file in case of ambiguity (@goldfirere, ocaml/merlin#1699) - Fix Merlin reporting errors provoked by the recovery itself (ocaml/merlin#1709, fixes ocaml/merlin#1704) - Add support for OCaml 5.1.1 (ocaml/merlin#1714) + editor modes - vim: load merlin when Vim is compiled with +python3/dyn (e.g. MacVim) - emacs: highlight only first error line by default (ocaml/merlin#1693, fixes ocaml/merlin#1663) [new release] merlin-lib and merlin (4.13-501) CHANGES: Fri Dec 1 15:00:42 CET 2023 + merlin binary - Fix a follow-up issue to the preference of non-ghost nodes introduced in ocaml/merlin#1660 (ocaml/merlin#1690, fixes ocaml/merlin#1689) - Add `-cache-lifespan` flag, that sets cache invalidation period. (ocaml/merlin#1698, ocaml/merlin#1705) - Ignore the new 5.1 `cmi-file` flag instead of rejecting it (ocaml/merlin#1710, fixes ocaml/merlin#1703) - Fix Merlin locate not fallbacking on the correct file in case of ambiguity (@goldfirere, ocaml/merlin#1699) - Fix Merlin reporting errors provoked by the recovery itself (ocaml/merlin#1709, fixes ocaml/merlin#1704) + editor modes - vim: load merlin when Vim is compiled with +python3/dyn (e.g. MacVim) - emacs: highlight only first error line by default (ocaml/merlin#1693, fixes ocaml/merlin#1663) [new release] merlin-lib and merlin (4.13-414) CHANGES: Fri Dec 1 15:00:42 CET 2023 + merlin binary - Fix a follow-up issue to the preference of non-ghost nodes introduced in ocaml/merlin#1660 (ocaml/merlin#1690, fixes ocaml/merlin#1689) - Add `-cache-lifespan` flag, that sets cache invalidation period. (ocaml/merlin#1698, ocaml/merlin#1705) - Fix Merlin locate not fallbacking on the correct file in case of ambiguity (@goldfirere, ocaml/merlin#1699) - Fix Merlin reporting errors provoked by the recovery itself (ocaml/merlin#1709, fixes ocaml/merlin#1704) + editor modes - vim: load merlin when Vim is compiled with +python3/dyn (e.g. MacVim) - emacs: highlight only first error line by default (ocaml/merlin#1693, fixes ocaml/merlin#1663)
CHANGES: Mon Dec 18 16:42:00 CET 2023 + merlin binary - Fix a follow-up issue to the preference of non-ghost nodes introduced in ocaml/merlin#1660 (ocaml/merlin#1690, fixes ocaml/merlin#1689) - Add `-cache-lifespan` flag, that sets cache invalidation period. (ocaml/merlin#1698, ocaml/merlin#1705) - Fix Merlin locate not fallbacking on the correct file in case of ambiguity (@goldfirere, ocaml/merlin#1699) - Fix Merlin reporting errors provoked by the recovery itself (ocaml/merlin#1709, fixes ocaml/merlin#1704) + editor modes - vim: load merlin when Vim is compiled with +python3/dyn (e.g. MacVim) - emacs: highlight only first error line by default (ocaml/merlin#1693, fixes ocaml/merlin#1663)
Second task from #1636
PoC:
The cache retention value was added to Mconfig. Call to
Mocaml.flush_caches
was moved to a place where Mconfig is available. Next step will be to create a flag that allows setting the config value from client. Last step is to use this flag from emacs/vim plugins.