Chaining components (e.g. referencing one component from another) is exponentially slow and CPU intensive. Example with `C --> B --> A`: ``` A: #dagger: compute: [] B: #dagger: compute: [ dagger.#FetchContainer & { ref: "alpine" }, dagger.#Exec & { args: ["sh", "-c", "echo hello world"] mount: "/tmp/A": from: A } ] C: #dagger: compute: [ dagger.#FetchContainer & { ref: "alpine" }, dagger.#Exec & { args: ["sh", "-c", "echo hello world"] mount: "/tmp/B": from: B } ] D: #dagger: compute: [ dagger.#FetchContainer & { ref: "alpine" }, dagger.#Exec & { args: ["sh", "-c", "echo hello world"] mount: "/tmp/C": from: C } ] ``` - The above takes 13 seconds to compute (CPU at full blast) - If I remove a layer (C mounts from A directly), it goes down to 1.3 seconds - If I add a layer (D which mounts from C), I don't know how long it takes, I killed it after 12 minutes of processing
Activity
aluzzardi commentedon Feb 8, 2021
Update: without using the imported definition, the performance is MUCH better:
DOCKER_OUTPUT=1 dagger compute ./examples/repro-102 2.75s user 0.15s system 110% cpu 2.608 totalThis is still exponentially slow, but much better. By adding
E:DOCKER_OUTPUT=1 dagger compute ./examples/repro-102 26.56s user 0.87s system 174% cpu 15.756 totalaluzzardi commentedon Feb 9, 2021
Using
dagger.#Op & {}withmount: from:seems to slow down cue pretty badly.cue eval 1.52s user 0.06s system 185% cpu 0.854 totalverdverm commentedon Mar 2, 2021
Relevant issues from Cue GH repo
aluzzardi commentedon Mar 9, 2021
I believe this has been fixed by #159
@verdverm Do you want to keep this issue open to track down the upstream issues, or should we just close it?
verdverm commentedon Mar 9, 2021
We can probably close it since this particular repro is not an issue anymore.
Do we have (or add) a label for
kind/perf?aluzzardi commentedon Mar 9, 2021
Okay closing this one then. Thanks!
Now we do :)
Merge pull request #102 from dagger/dependabot/go_modules/github.com/…
core/workspace: legacy migration writes [sdks.*] sections
core/workspace: legacy migration writes [sdks.*] sections
core/workspace: legacy migration writes [sdks.*] sections
core/workspace: legacy migration writes [sdks.*] sections
core/workspace: legacy migration writes [sdks.*] sections
core/workspace: legacy migration writes [sdks.*] sections