Run clang-format in parallel
Categories
(Developer Infrastructure :: Lint and Formatting, enhancement)
Tracking
(firefox67 fixed)
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: bbouvier, Assigned: bbouvier)
References
Details
Attachments
(1 file, 1 obsolete file)
I'd like to make clang-format a first class citizen in my workflow by having mercurial commit hooks (or some form of hook) running clang-format for me. At the moment, it is really really slow, though; it takes around 10 seconds to run just for the js/src/wasm directory, even when it's already correctly formatted. My machine is quite powerful, with SSD disks and yadda yadda, so I'd expect this to take less time.
Sylvestre on IRC told me that we're not doing this in parallel (for instance, we could run N processes, where N is the number of CPUs on the machine or so).
Anything that would reduce the time to run clang-format in general would be really nice to have.
Comment 1•6 years ago
|
||
See the discussion in this other bug. If we decide to go that route, we can likely close/dupe this to that bug.
Updated•6 years ago
|
Assignee | ||
Comment 2•6 years ago
|
||
Some quick benchmark using the multiprocessing Python module:
- on js/src/wasm (52 files), run time went from 11 seconds to 5 on my machine (CPU usage around 300%, not great).
- on js/src (1086 files), run time went from 1 minute 40 seconds down to 11 seconds on my machine (CPU usage around 1400%, better but still not perfect considering I've got 28 cores so it could be up to 2800%).
What do you think of landing this until we get a better proper implementation that works for all the lint tools (as suggested in the other bug that i skimmed, so maybe i misunderstood it)?
Comment 3•6 years ago
|
||
Assignee | ||
Comment 4•6 years ago
|
||
Updated•6 years ago
|
Comment 6•6 years ago
|
||
bugherder |
Comment 7•6 years ago
|
||
Updated•6 years ago
|
Updated•3 years ago
|
Description
•