mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 09:17:43 +03:00
f0e5bed36f
* DAML-LF: Add interning for type to DAML-LF 1.dev We add two new features to DAML-LF 1.dev: * a per package list (or table) of `Type` messages, and * a new case in the `Type` message which is an index into this table. In combination, these two features can be used to allow DAML-LF encoders to perform hash-consing of `Type` messages. We also change the Haskell implementation of our DAML-LF encoder to do exactly that when targetting DAML-LF 1.dev. Doing this has a few benefits: 1. The DALFs produced by `damlc` get smaller: I've seen a case where the size dropped from 69MB to 45MB. 2. DAML-LF decoders need to decode less data. 3. Decoded packages use less memory because identical structures are now shared. This is particularly helpful in situations where we need to keep the interface (or signature) of a package in memory for a long time. This PR mostly takes care of the Haskell implementation. However, we need to make the Scala implementation of the decoder aware of the new features as well since we have tests that load DAML-LF 1.dev into the engine. A decoder and _targeted_ tests on the Scala side will follow in a separate PR. CHANGELOG_BEGIN CHANGELOG_END * Make jq tests aware of type interning CHANGELOG_BEGIN CHANGELOG_END * Improve jq test CHANGELOG_BEGIN CHANGELOG_END * Apply Remy's suggestions Co-authored-by: Remy <remy.haemmerle@daml.com> * Improve the imperative bits CHANGELOG_BEGIN CHANGELOG_END Co-authored-by: Remy <remy.haemmerle@daml.com> |
||
---|---|---|
.. | ||
main | ||
test |