merlin icon indicating copy to clipboard operation
merlin copied to clipboard

Typer very high when we run occurrences or locate commands

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

We ran ocamlmerlin occurrences and locate commands and we noticed that the typer is abnormally high whereas when we ran type-enclosing command on the same position we can notice that the typer is significantly much lower. As you can see with the three examples below :

Occurrences command : ocamlmerlin single occurrences -identifier-at 49:8 -filename ./src/irmin-mirage/git/irmin_mirage_git.ml < ./src/irmin-mirage/git/irmin_mirage_git.ml | jq .

{
  "class": "return",
  "value": [
    {
      "start": {
        "line": 49,
        "col": 7
      },
      "end": {
        "line": 49,
        "col": 10
      }
    },
    {
      "start": {
        "line": 347,
        "col": 17
      },
      "end": {
        "line": 347,
        "col": 20
      }
    }
  ],
  "notifications": [],
  "timing": {
    "clock": 2099,
    "cpu": 2075,
    "query": 5,
    "pp": 0,
    "reader": 3,
    "ppx": 0,
    "typer": 2066,
    "error": 0
  }
} 

Locate command : ocamlmerlin single locate -look-for ml -position 49:8 -filename ./src/irmin-mirage/git/irmin_mirage_git.ml < ./src/irmin-mirage/git/irmin_mirage_git.ml | jq .

{
  "class": "return",
  "value": "Already at definition point",
  "notifications": [],
  "timing": {
    "clock": 2200,
    "cpu": 2138,
    "query": 2,
    "pp": 0,
    "reader": 3,
    "ppx": 0,
    "typer": 2133,
    "error": 0
  }
}

type-enclosing command : ocamlmerlin single type-enclosing -position 49:8 -verbosity 0 \ < ./src/irmin-mirage/git/irmin_mirage_git.ml | jq

{
  "class": "return",
  "value": [
    {
      "start": {
        "line": 49,
        "col": 7
      },
      "end": {
        "line": 49,
        "col": 10
      },
      "type": "sig end",
      "tail": "no"
    },
    {
      "start": {
        "line": 49,
        "col": 0
      },
      "end": {
        "line": 61,
        "col": 3
      },
      "type": "sig end",
      "tail": "no"
    }
  ],
  "notifications": [],
  "timing": {
    "clock": 10,
    "cpu": 10,
    "query": 1,
    "pp": 0,
    "reader": 3,
    "ppx": 0,
    "typer": 5,
    "error": 0
  }
}

@art-w

Zineb-Ada avatar Jun 28 '22 16:06 Zineb-Ada

“Typer is abnormally high” 😁

(sorry for noise)

ulugbekna avatar Jul 01 '22 11:07 ulugbekna

I just tried Merlin 4.11-501 on some Irmin file and it's still very slow. Although not the typing...

https://github.com/ocamllabs/vscode-ocaml-platform/issues/954#issuecomment-1735447318

voodoos avatar Sep 26 '23 12:09 voodoos