aspect-build / aspect-build/rules_js

[Bug]: Perf: Slow postprocessing.run action after `js_image_layer`'s entries write

Open
#2,529 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Starlark
Stars
378
Forks
183
Avg merge
1d 9h
Merged PRs (30d)
32

Description

### What happened?

When using js_image_layer on js_binary targets with many inputs (100k+) we're observing very slow `postprocessing.run` events in the Bazel profiles. These occur every-time, also when fully cached.

The snips are from a CI linux runner profile.
Image
Image

### Version

Development (host) and target OS/architectures: macOS & k8 + Engflow remote cache

Output of `bazel --version`: release 7.4.1

Version of the Aspect rules, or other relevant rules from your
`WORKSPACE` or `MODULE.bazel` file: rules_js 2.8.1

Language(s) and/or frameworks involved: JS

### How to reproduce

```shell
The entries.json generated is usually over 150MB with more than 500k lines in some of our services.

So the js_binary should depend on node modules with many files.
```

### Any other information?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with a js_binary depending on node modules with many files, then inspect Bazel profiles for repeated postprocessing.run events after js_image_layer writes entries.json. Compare behavior with fully cached builds and the reported large entries.json sizes. Done should include a measured explanation of the postprocessing delay and a verified improvement.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.