Skip to content

Conversation

aspeddro
Copy link
Contributor

@aspeddro aspeddro commented Nov 14, 2022

  • It was calling Cmt.fullFromPath for each hint.
  • Removes inlay hints for parameters. It's not necessary as code lenses already do this job.

A noticeable change to analysis/examples/large-project/src/res_core.res

Is there any way to measure?

Part of #511

cc @zth

@aspeddro aspeddro changed the title Polish: better inlay hints and codelens performance Polish: inlay hints and codelens performance Nov 14, 2022
@zth
Copy link
Member

zth commented Nov 28, 2022

Having a look at this soon, sorry for the wait!

@zth
Copy link
Member

zth commented Nov 28, 2022

@aspeddro we don't have any real benchmarks unfortunately. When I've tested I've clocked how long refreshing takes for us in that large file vs TS in a large TS file.

Copy link
Member

@zth zth left a comment

Choose a reason for hiding this comment

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

I think this looks good. @cristianoc might want to have a glance. @aspeddro mind pulling in the latest master too? There's a conflict.

};
})
| _ -> None))
match Cmt.fullFromPath ~path with
Copy link
Member

Choose a reason for hiding this comment

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

I think this is great. Question for the future: does it make sense to have some sort of cache inside of Cmt.fullFromPath directly?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The change looks good. Perhaps it's possible to rename fullFromPath to something that makes it clear it's an expensive operation. E.g. loadFullCmtFromPath.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 0f26053

@zth zth merged commit 75bccdd into rescript-lang:master Nov 30, 2022
@aspeddro aspeddro deleted the polish-inlay-hints-performance branch December 19, 2022 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants