Skip to content

Cache hit/miss stats#1711

Merged
voodoos merged 3 commits intoocaml:masterfrom
3Rafal:cache-stats
Dec 18, 2023
Merged

Cache hit/miss stats#1711
voodoos merged 3 commits intoocaml:masterfrom
3Rafal:cache-stats

Conversation

@3Rafal
Copy link
Copy Markdown
Collaborator

@3Rafal 3Rafal commented Nov 22, 2023

This PR adds cache statistics to merlin's telemetry, as in #1707
Example output:

"cache":{
   "reader_phase":"miss",
   "ppx_phase":"miss",
   "typer":{
      "reused":11,
      "typed":0
   },
   "cmt":{
      "hit":0,
      "miss":0
   },
   "cmi":{
      "hit":62,
      "miss":0
   }
}

@3Rafal 3Rafal force-pushed the cache-stats branch 2 times, most recently from 1daec00 to 6a5adf2 Compare December 8, 2023 12:12
3Rafal added a commit to 3Rafal/merlin that referenced this pull request Dec 8, 2023
@3Rafal 3Rafal marked this pull request as ready for review December 8, 2023 12:17
3Rafal added a commit to 3Rafal/merlin that referenced this pull request Dec 11, 2023
@3Rafal
Copy link
Copy Markdown
Collaborator Author

3Rafal commented Dec 11, 2023

@voodoos , this PR is ready to be reviewed.

3Rafal added a commit to 3Rafal/merlin that referenced this pull request Dec 13, 2023
Copy link
Copy Markdown
Collaborator

@voodoos voodoos left a comment

Choose a reason for hiding this comment

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

Thanks Rafal !
Could you make a last rebase to fix the changelog conflict ?

@3Rafal
Copy link
Copy Markdown
Collaborator Author

3Rafal commented Dec 18, 2023

Thanks @voodoos , it should be good now :-)

@voodoos voodoos merged commit d0ea17f into ocaml:master Dec 18, 2023
voodoos added a commit to voodoos/merlin that referenced this pull request Feb 20, 2024
voodoos added a commit to voodoos/opam-repository that referenced this pull request Feb 22, 2024
CHANGES:

Thu Feb 22 14:00:42 CET 2024

  + merlin binary
    - Add a "heap_mbytes" field to Merlin server responses to report heap usage (ocaml/merlin#1717)
    - Add cache stats to telemetry (ocaml/merlin#1711)
    - Add new SyntaxDocument command to find information about the node under the cursor (ocaml/merlin#1706)
    - Fix `FLG -pp ppx.exe -as-pp/-dump-ast` use of invalid shell redirection when
    direct process launch on Windows. (ocaml/merlin#1723, fixes ocaml/merlin#1722)
    - Add a query_num field to the `ocamlmerlin` responses to detect server crashes (ocaml/merlin#1716)
    - Jump to cases within a match statement (ocaml/merlin#1726)
    - Jump to `module-type` (ocaml/merlin#1728, partially fixes ocaml/merlin#1656)
    - Exposes stable functions for configuration handling and pattern variable
      destruction. (ocaml/merlin#1730)
  + editor modes
    - vim: load merlin under the ocamlinterface and ocamllex filetypes (ocaml/merlin#1340)
    - Fix merlinpp not using binary file open (ocaml/merlin#1725, fixes ocaml/merlin#1724)
voodoos added a commit to voodoos/opam-repository that referenced this pull request Feb 22, 2024
CHANGES:

Thu Feb 22 14:00:42 CET 2024

  + merlin binary
    - Add a "heap_mbytes" field to Merlin server responses to report heap usage (ocaml/merlin#1717)
    - Add cache stats to telemetry (ocaml/merlin#1711)
    - Add new SyntaxDocument command to find information about the node under the cursor (ocaml/merlin#1706)
    - Fix `FLG -pp ppx.exe -as-pp/-dump-ast` use of invalid shell redirection when
    direct process launch on Windows. (ocaml/merlin#1723, fixes ocaml/merlin#1722)
    - Add a query_num field to the `ocamlmerlin` responses to detect server crashes (ocaml/merlin#1716)
    - Jump to cases within a match statement (ocaml/merlin#1726)
    - Jump to `module-type` (ocaml/merlin#1728, partially fixes ocaml/merlin#1656)
    - Exposes stable functions for configuration handling and pattern variable
      destruction. (ocaml/merlin#1730)
  + editor modes
    - vim: load merlin under the ocamlinterface and ocamllex filetypes (ocaml/merlin#1340)
    - Fix merlinpp not using binary file open (ocaml/merlin#1725, fixes ocaml/merlin#1724)
voodoos added a commit to voodoos/opam-repository that referenced this pull request Feb 22, 2024
CHANGES:

Thu Feb 22 14:00:42 CET 2024

  + merlin binary
    - Add a "heap_mbytes" field to Merlin server responses to report heap usage (ocaml/merlin#1717)
    - Add cache stats to telemetry (ocaml/merlin#1711)
    - Add new SyntaxDocument command to find information about the node under the cursor (ocaml/merlin#1706)
    - Fix `FLG -pp ppx.exe -as-pp/-dump-ast` use of invalid shell redirection when
    direct process launch on Windows. (ocaml/merlin#1723, fixes ocaml/merlin#1722)
    - Add a query_num field to the `ocamlmerlin` responses to detect server crashes (ocaml/merlin#1716)
    - Jump to cases within a match statement (ocaml/merlin#1726)
    - Jump to `module-type` (ocaml/merlin#1728, partially fixes ocaml/merlin#1656)
    - Exposes stable functions for configuration handling and pattern variable
      destruction. (ocaml/merlin#1730)
  + editor modes
    - vim: load merlin under the ocamlinterface and ocamllex filetypes (ocaml/merlin#1340)
    - Fix merlinpp not using binary file open (ocaml/merlin#1725, fixes ocaml/merlin#1724)
voodoos added a commit to voodoos/opam-repository that referenced this pull request Feb 22, 2024
CHANGES:

Thu Feb 22 14:00:42 CET 2024

  + merlin binary
    - Add a "heap_mbytes" field to Merlin server responses to report heap usage (ocaml/merlin#1717)
    - Add cache stats to telemetry (ocaml/merlin#1711)
    - Add new SyntaxDocument command to find information about the node under the cursor (ocaml/merlin#1706)
    - Fix `FLG -pp ppx.exe -as-pp/-dump-ast` use of invalid shell redirection when
    direct process launch on Windows. (ocaml/merlin#1723, fixes ocaml/merlin#1722)
    - Add a query_num field to the `ocamlmerlin` responses to detect server crashes (ocaml/merlin#1716)
    - Jump to cases within a match statement (ocaml/merlin#1726)
    - Jump to `module-type` (ocaml/merlin#1728, partially fixes ocaml/merlin#1656)
    - Exposes stable functions for configuration handling and pattern variable
      destruction. (ocaml/merlin#1730)
  + editor modes
    - vim: load merlin under the ocamlinterface and ocamllex filetypes (ocaml/merlin#1340)
    - Fix merlinpp not using binary file open (ocaml/merlin#1725, fixes ocaml/merlin#1724)
liam923 added a commit to liam923/merlin that referenced this pull request Jun 13, 2025
* Revert "occurrences: add support for project-wide occurrences"

This reverts commit fa1e8b1.

* occurrences: do not attempt to shrink the selection of idents that needs parenthesis

Doing that properly require compiler support for located longidents.

cherry picked from upstream commit 1850cbe

* refactor: extract identifier parsing from query commands

cherry picked from upstream commit 082a1ac

* occ: improve handling of paths in current buffer

cherry picked from upstream commit 02959ba

* test: promote

cherry picked from upstream commit a1547db

* test: show issue with paths that need parens / spaces

cherry picked from upstream commit a687b15

* Make reconstruct identifier more robust

It's always correct to have a space after the parenthesis and it is sometimes
necessary, for infix operators that start with `*` for example.

cherry picked from upstream commit ab56eea

* promote slight test improvement

cherry picked from upstream commit ee41c4d

* context: improve cursor position detection

cherry picked from upstream commit 9f8cbf4

* Revert: remove raparsing of longident to index modules in paths

This reparsing has very bad performances. The correct way to deal with
issue is to have the compiler store precise locations in longidents.

cherry picked from upstream commit df27557

* Upgrade dune to 3.0 and fix warnings

dune 2.9.0 is not compatible with OCaml 5.2 anyway.

cherry picked from upstream commit 617a91d

* lib: expose config manipulation utilities

cherry picked from upstream commit b77b724

* config: handle SOURCE_ROOT directive

cherry picked from upstream commit dd23fbd

* occurrences: add support for project-wide occurrences

cherry picked from upstream commit 34e2688

* [emacs] handle project-wide-occurrences in  occur-mode

cherry picked from upstream commit a34cc1c

* Backport PR ocaml#1717 from upstream

* Backport PR ocaml#1711 from upstream

* refactor: properly define mtyper cache type

cherry picked from upstream commit 1577d8f

* Do not traverse `merlin.hide` nodes when iterating

cherry picked from upstream commit 4d5560e

* occurrences: incrementally index the buffer in Mtyper

cherry picked from upstream commit a4bb508

* Correctly identify which locs are in the current buffer

cherry picked from upstream commit 139272e

* occ: add a test showing clashes between mli and ml uids

cherry picked from upstream commit a0dbfb2

* occ: do no return PWO for definitions in a mli

We don't have a way to identify uids in interfaces with uids in
implementations. This might lead to mixing up results that share
the same uid.

cherry picked from upstream commit 38c28f2

* test: add test showing issue with at origin occurrences

Labels and constructors are not highlighted correctly when the cursor is on their declaration

cherry picked from upstream commit af14a1f

* Better context inference

cherry picked from upstream commit 7bd03f0

* Fix crashing when logging lid

cherry picked from upstream commit 5b96c62

* Backport PR ocaml#1779 from upstream

* Revert "Do not traverse `merlin.hide` nodes when iterating"

This reverts commit 24ba67e4761f045139f5767d3e26c0a17084b002.

* Add cms cache support to cache information

---------

Co-authored-by: Ulysse Gérard <thevoodoos@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 4.14-500

Development

Successfully merging this pull request may close these issues.

3 participants