rules_swc icon indicating copy to clipboard operation
rules_swc copied to clipboard

Performance feedback

Open matthewjh opened this issue 2 years ago • 0 comments

What happened?

rules_swc is great, but I think the performance of this ruleset could be improved by some tweaks to the action graph it creates. Presently, one action is created per file, which creates immense overhead. Doing a cold build of a large codebase takes 30+ mins when SWC unencumbered could probably eat through it in less than a minute. This appears to be Bazel overhead from spawning so many actions, and them consequently being queued up. For (a) performance and (b) because it didn't appear to add much value, I disabled sandboxing in .bazelrc for SWCTranspile, but needless to say, sandboxing on top is going to further inflate the time taken. I imagine one-action-per-file is also costly from a remote cache / RBE perspective.

After a cold build, incremental build time is superb, but I think it would be just as fast with, say, 5-10 files per action as 1. Perhaps an int attr could be added that specifies how many files will be inputs to each action, with a default that is greater than 1 but not too large either, to enable some economy of scale..

Version

~

How to reproduce

No response

Any other information?

No response

Fund our work

  • [ ] Sponsor our open source work by donating a bug bounty

matthewjh avatar Nov 11 '22 08:11 matthewjh