Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Finer dependencies for GhcSessionFun #643

Merged
merged 5 commits into from
Jun 22, 2020

Conversation

pepeiborra
Copy link
Collaborator

Now GhcSession tracks the component dependencies, and GhcSessionIO (no file) tracks the set of components. Since GhcSession has a dependency on GhcSessionIO, this works out as intended: if the set of components changes, all the Ghc sessions become invalidated. Otherwise, a Ghc session is invalidated only when the component dependencies (e.g. the Cabal file) change.

Another 10% perf improvement.

Fixes #619

Benchmarks where HEAD is this patch, upstream is the previous master:

version    name                         success   samples   startup              setup                experiment           maxResidency
upstream   hover                        True      100       10.008805828         0.0                  1.0496357980000002   138MB
upstream   edit                         True      100       10.342245301         0.0                  40.515747643000005   137MB
upstream   getDefinition                True      100       20.589914577000002   0.0                  0.537914714          324MB
upstream   hover after edit             True      100       9.944694886          0.0                  89.364840677         156MB
upstream   completions after edit       True      100       9.465573668000001    0.0                  50.609864630000004   148MB
upstream   code actions                 True      100       9.376972059          0.6628133180000001   0.96582895           166MB
upstream   code actions after edit      True      100       10.779993297         0.0                  41.802328869         171MB
upstream   documentSymbols after edit   True      100       9.692719622          0.0                  3.1590869070000003   133MB
HEAD       hover                        True      100       10.359037769         0.0                  0.8585313830000001   137MB
HEAD       edit                         True      100       9.726820669          0.0                  31.940400373000003   137MB
HEAD       getDefinition                True      100       21.827025083000002   0.0                  0.648860783          318MB
HEAD       hover after edit             True      100       9.524636392000001    0.0                  80.23256079800001    156MB
HEAD       completions after edit       True      100       10.814269279000001   0.0                  43.996691731000006   143MB
HEAD       code actions                 True      100       9.39776919           0.595851581          0.9932212890000001   166MB
HEAD       code actions after edit      True      100       9.59566279           0.0                  38.154787442         171MB
HEAD       documentSymbols after edit   True      100       9.920586814          0.0                  3.0366749910000004   135MB

Graphs here: https://github.com/pepeiborra/ghcide/tree/GhcSession-alwaysRerun-benchmarks/bench-hist

Edit experiment

Hover after edit experiment

Copy link
Collaborator

@cocreature cocreature left a comment

Choose a reason for hiding this comment

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

Nice! 2 comments

src/Development/IDE/Types/Options.hs Show resolved Hide resolved
exe/Main.hs Show resolved Hide resolved
@pepeiborra pepeiborra force-pushed the GhcSession-alwaysRerun branch from 23b1776 to 2d9648f Compare June 22, 2020 11:33
@pepeiborra
Copy link
Collaborator Author

Rebased

Copy link
Collaborator

@cocreature cocreature left a comment

Choose a reason for hiding this comment

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

Thanks!

@cocreature cocreature merged commit 7080db9 into haskell:master Jun 22, 2020
pepeiborra added a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Cache the results of loadSession until the components change

* Track the cradle dependencies

* hlint

* Add cradle to watched files test

* Add comment on sessionVersion field
pepeiborra added a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Cache the results of loadSession until the components change

* Track the cradle dependencies

* hlint

* Add cradle to watched files test

* Add comment on sessionVersion field
pepeiborra added a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Cache the results of loadSession until the components change

* Track the cradle dependencies

* hlint

* Add cradle to watched files test

* Add comment on sessionVersion field
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GhcSessionFun should not be alwaysRerun
2 participants