daml/compiler/repl-service
Jussi Mäki fa9bc4a984
Cache computation of top-level values at definition level (#7818)
* Cache computation of top-level values at definition level

Earlier the computation of a top-level value was only cached at the
use-site in SEVal. This introduces SDefinition which contains the same
mechanism as SEVal to cache the computation.

As expected this does not impact performance much:

before: CollectAuthority.bench  //daml-lf/scenario-interpreter/CollectAuthority.dar  CollectAuthority:test  avgt   40  44.267 ± 0.728  ms/op
after: CollectAuthority.bench  //daml-lf/scenario-interpreter/CollectAuthority.dar  CollectAuthority:test  avgt   40  43.693 ± 0.702  ms/op

What this does have a significant impact is on reducing the number of distinct
SValues for things like type class dictionaries etc, so that now we have one
SValue per dictionary rather than one per SEVal.

CHANGELOG_BEGIN
CHANGELOG_END

* Address code review

* Fix speedy tests
2020-10-28 13:39:20 +00:00
..
client Add :json command to DAML REPL (#7202) 2020-08-21 14:53:06 +00:00
protos Add :json command to DAML REPL (#7202) 2020-08-21 14:53:06 +00:00
server Cache computation of top-level values at definition level (#7818) 2020-10-28 13:39:20 +00:00