Slow Daml compilation

Assume I have two Daml projects: huge and small.

In huge there is an enormous Daml file, this is inherent, nothing to do about it. This results in quite slow compilation, that is expected.

In the small project I have only two very small Daml files, and a data-dependency to the huge DAR. I expected a fast compilation, however it takes almost the same amount of time as the other one.

If I add the DAR as dependency the compilation is much faster. Why is that? I assumed it would be the other way around.

Rough figures are 0.45s vs 57s.

1 Like

data-dependencies should be slow once since it has to create some dummy interface files which it needs to support cross-SDK dependencies. However, those should be cached in recent SDKs (1.12 should work I think 1.11 as well) unless you modify that dependency and following compilations should be as quick as dependencies.

If that’s not the case, that’s a bug so it would be great if you could provide instructions for how we can reproduce this.

1 Like

Here’s the repo and the branch: GitHub - digital-asset/lib-message-integration at example-accord-app

In the example-accord folder there is the ledger-setup project. Change the dependency to the models DAR to data-dependency. If I understood you correctly the following should happen:

DAML_PROJECT=models daml build # expected to be slow
DAML_PROJECT=ledger-setup daml build # expected to be slow
DAML_PROJECT=ledger-setup daml build # expected to run effeciently
1 Like

I can’t reproduce the issue.

  1. I get something closer to ~5s for dependencies not 0.5s. Maybe it’s my machine but seems like a surprisingly large difference.
  2. Ignoring that, I get the expected slow build the first time but the second run is ~5s with data-dependencies as well as dependencies.

So the caching seems to work both on SDK 1.11.0 as well as 1.13.1.

1 Like

I bumped up to version to 1.13.1 to see if it makes a difference. The performance was fast the second time, as expected.

Strangely, when I reverted back to 1.11.0 the performance was also fine, and it works as expected ever since. Maybe it was just a hiccup.