Replies: 1 comment 4 replies
-
Original reply by @verdverm in cuelang/cue#1074 (comment) I have found manually "unrolling" to improve speeds drastically. This has been largely about inlining definitions, but of course means losing reusable components. There are a number of issues tagged with performance and some known optimizations still to be implemented. The first thing I might recommend w.r.t. PRs is getting to know the evaluator. There are a lot of comments and todos in the codebase as well as background reading that is helpful. The evaluator is a complicated thing and I'd guess @mpvl is the only one who really understands it's implementation right now. One thing that has helped me is running various simple cases with expanded output. The majority of the interesting code is in the internal directory. |
Beta Was this translation helpful? Give feedback.
-
Originally opened by @nyarly in cuelang/cue#1074
I've come up against the issue of CUE code taking a long time and lots of memory to process a number of times, and I still haven't really gotten a feel for how to fix this. Most recently, after 20 minutes my
cue export
got OOMkilled. It's unclear to me what exactly causes the time and space of CUE processing to run away like this, or how to find those causes.For reference, this is about 100kloc of CUE, that results in about 300kloc of Kubernetes YAML. There's a fair amount of literal inclusion there, from importing upstream raw config - I'd guess about 80%! (MISSING)
That said, the stalling out seems to happen as I refactor to better represent intent. My goal right now is to be able to compose the features required by a particular cluster out of struct-based configurations. Eventually I might also want to remove Kustomize from our workflow, but right now it's serving a valuable purpose patching resources and unifying namespaces. I'm making strides towards mergeable feature configurations, only to be held up by extremely lengthy builds.
As new releases of the tool drop, they've made noticeable differences in build speed. Which is greatly appreciated! My temperament wants to solve its own problems, though. Even if that means contributing PRs up to the toolchain.
(I'm on track to get our code into the private unity program, and I'm excited to see how that pans out.)
Beta Was this translation helpful? Give feedback.
All reactions