Repository navigation
perf(input): compile sources in parallel, each in its directory - #272
Draft
SizzleUnrlsd wants to merge 5 commits into
Draft
SizzleUnrlsd wants to merge 5 commits into
SizzleUnrlsd wants to merge 5 commits into
Conversation
…rectory The pinned commit, from CoreTrace/coretrace-compiler#262, gives each compilation a file system of its own, whose working directory -working-directory moves while the process's stays. The analyzer does not use it yet: it still moves the process around each compilation, under its lock. Refs #271
Every compilation held one global lock and moved the whole process to its compile command's directory: the --jobs threads compiled one source at a time. coretrace-compiler now gives each compilation the directory of its -working-directory without moving the process: the analyzer passes the directory that way, and compilations share the lock. Some compilations still hold it alone, since they change state that the whole process shares: those with an option that Clang applies to LLVM's state (-mllvm, -mdebug-pass, -mlimit-float-precision, -ftime-report), and those with -fno-integrated-cc1, whose jobs run as programs, for which coretrace-compiler moves the process. A compile command whose directory does not exist still fails the analysis: coretrace-compiler reports a directory it cannot enter, but compiles to memory all the same, so the analyzer checks the directory itself, with the message it gave before. Refs #271
The newer commit of CoreTrace/coretrace-compiler#262 also writes the fragment of -MJ, the statistics of -save-stats, the graph of -dependency-dot and the module cache in the directory of -working-directory, as the analyzer did when it moved the process there. Refs #271
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every compilation held
gCompileInvokeMutexand moved the whole process to its compile command's directory, so the--jobsthreads compiled one source at a time (#271). coretrace-compiler now gives each compilation the directory of its-working-directorywithout moving the process (CoreTrace/coretrace-compiler#262): the analyzer passes each compile command's directory that way, and compilations share the lock.Closes #271
Change
build(deps): pin coretrace-compiler to its per-compilation working directory: a commit of feat(compilerlib): give each compilation a working directory of its own coretrace-compiler#262, a draft. This pull request waits for it, and should pin the release that brings it.perf(input): compile sources in parallel, each in its directory:-working-directory <directory>is prepended to the compile command's arguments;ScopedCurrentPath, which moved the process, is gone;-mllvm,-mdebug-pass,-mlimit-float-precision,-ftime-report), or with-fno-integrated-cc1, whose jobs run as programs for which coretrace-compiler moves the process, take it alone, as coretrace-compiler asks.docs(readme)anddocs(changelog).build(deps): pin coretrace-compiler to its fix of the files -MJ writes: a newer commit of feat(compilerlib): give each compilation a working directory of its own coretrace-compiler#262, which also writes the fragment of-MJ, the statistics of-save-stats, the graph of-dependency-dotand the module cache in the directory of-working-directory, where this analyzer wrote them when it moved the process there.A compile command whose directory does not exist still fails the analysis, with the message it gave before. coretrace-compiler reports such a directory, but compiles to memory all the same (CoreTrace/coretrace-compiler#264), so the analyzer checks the directory itself before compiling.
Measurements
macOS arm64 (M3, 8 cores), LLVM 20.1.2,
--format=json --timing, no IR cache, an empty resource summary cache. Both builds use coretrace-compiler from source: main (f0a22d9) for db7fb25, CoreTrace/coretrace-compiler#262 for this branch. Medians of 5 runs, 3 for the 53 sources; the builds alternate within each repetition.--jobs--jobs=2, 239 MB to 328 MB for the 8 C++ files, 1.26 GB to 1.42 GB for the 53 sources.Tests
Local runs, on macOS arm64 with AppleClang and LLVM 20.1.2, this branch built as a user builds it, coretrace-compiler fetched at the pinned commit, so that the compile IR cache is in use:
run_test.py --jobs 2 --no-cache: 2696/2696 at the head, e6ae53e, at d642039, before the second pin, and at the first commit, the first pin alone.check_resource_model_across_compile_directoriescompiles eight sources, each from a directory of its own with a header of the same name as a decoy in the start directory, at the default, 1 and 4 jobs.Failed to change working directory to: <directory>, as with db7fb25.scripts/format-check.shwith clang-format 20,scripts/check-license-compliance.shand the commit checker pass.