-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speed up parsing @args.rsp compiler arguments #26554
Conversation
Thank you! I started a build for a Haskell project to test this PR. Being a big rebuild it will likely take a while to complete but will post results once it finishes (unless this gets merged first). |
b7ada0e
to
e635a0d
Compare
I seem to be getting a failure building ghc-7.10.3 https://gist.github.com/pbogdan/9f40ebd95cdbbba3e7408ac18c8327a4 😕 Can't debug further right now but looks like something related to treatment of arguments enclosed within escaped quotes. |
I straced the failing command, abbreviated output below:
My current reading of what's happening is:
|
Improves upon NixOS#25205 https://gist.github.com/pbogdan/9d6986bf931b58a70d75e14eb40ee8a1 parsing time is reduced from one minute to one second
Thank you! I had to add |
I have another build running with the updated PR. It's unlikely to finish before I head to bed so might take some time before I can report back. |
The following test build succeeded. Built on top of master @ 90cf4cf. The timings for building just the Haskell project once all dependencies are built: before:
after:
That's on a project with 13 modules in the library component, 3 executables, a dummy test suite and sizeable dependency footprint. |
I don't know how many times the wrapper is called, but it's still in almost two orders of magnitude slower than in release-17.03 branch (using the above gist as a test). rsp branch:
release-17.03 branch:
|
It certainly is slower than parsing with eval in the release: args=$(<"${p:1}")
eval 'for arg in '${args//$/\\$}'; do params+=("$arg"); done' which incorrectly parses some files with |
I think we should merge this and open an issue to rewrite the parsing in C++. |
Improves upon #25205.
https://gist.github.com/pbogdan/9d6986bf931b58a70d75e14eb40ee8a1 parsing time is
reduced from one minute to one second.