ocaml-lsp icon indicating copy to clipboard operation
ocaml-lsp copied to clipboard

Performance issue "Go to definition"

Open Zineb-Ada opened this issue 3 years ago • 0 comments

We work on VS code with ocaml versions 4.13.1 (merlin version v4.4-413) and 4.14.0 (merlin version v4.5-414). we noticed that there is a performance issue on some Irmin files “https://github.com/mirage/irmin". Indeed, when I click on “go to definition” it takes on average thirty seconds to jump to the definition , especially in the file “src/pack/mem/irmin_pack_mem.ml” line 171 column 13. When we run the same query from the command line “ocamlmerlin single locate -look-for ml -position 171:13 -filename src/irmin-pack/mem/irmin_pack_mem.ml < src/irmin-pack/mem/irmin_pack_mem.ml | jq .” with Merlin it takes less than 0.5 seconds

{
  "class": "return",
  "value": {
    "file": "/Users/tarides/Desktop/Tarides-Ocaml/irmin/src/irmin/irmin.ml",
    "pos": {
      "line": 1,
      "col": 0
    }
  },
  "notifications": [],
  "timing": {
    "clock": 547,
    "cpu": 424,
    "query": 230,
    "pp": 0,
    "reader": 1,
    "ppx": 27,
    "typer": 166,
    "error": 0
  }
}

We tested on two laptops running macOS. We also tested on other workspaces and noticed that the bug only occurs with Irmin on Vscode. Indeed we tested on VIM with neovim lsp and ocaml-lsp-server but we could not reproduce the bug, so we assumed that the problem is related to the Vs code plugins.

Zineb-Ada avatar May 17 '22 15:05 Zineb-Ada