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
Bash runner script exhibits quadratic performance and is unreasonably slow with many source files #9279
Milestone
Comments
Imported From: https://issues.scala-lang.org/browse/SI-9279?orig=1 |
@SethTisue said: |
retronym
added a commit
to retronym/scala
that referenced
this issue
May 3, 2017
Echoing the performance bug in the bash scripts (scala/bug#9279), the command line parser exhibited exponential performance. When using the command line arguments used to compile the standard library, which contains ~ 700 source files, I noticed about 1% of compilation time was being spend in evaluating the regex `(\S+)(.*)`. Inspection of the parser reveals that this was repeatedly being called on the rest of the command line as the parser consumed each argument. This commit switches to using a regex that only matches the current argument, and then makes sure to split the input string using structural sharing of the backing char[] (by using `CharSequence.subsequence`, rather than high level Scala collections operations from `StringLike`). After this change, I no longer this area of code in the profiler results.
retronym
added a commit
to retronym/scala
that referenced
this issue
May 3, 2017
Echoing the performance bug in the bash scripts (scala/bug#9279), the command line parser exhibited exponential performance. When using the command line arguments used to compile the standard library, which contains ~ 700 source files, I noticed about 1% of compilation time was being spend in evaluating the regex `(\S+)(.*)`. Inspection of the parser reveals that this was repeatedly being called on the rest of the command line as the parser consumed each argument. This commit switches to using a regex that only matches the current argument, and then makes sure to split the input string using structural sharing of the backing char[] (by using `CharSequence.subsequence`, rather than high level Scala collections operations from `StringLike`). After this change, I no longer observed this area of code in the top profiler results.
retronym
added a commit
to retronym/scala
that referenced
this issue
May 15, 2017
Echoing the performance bug in the bash scripts (scala/bug#9279), the command line parser exhibited exponential performance. When using the command line arguments used to compile the standard library, which contains ~ 700 source files, I noticed about 1% of compilation time was being spend in evaluating the regex `(\S+)(.*)`. Inspection of the parser reveals that this was repeatedly being called on the rest of the command line as the parser consumed each argument. This commit switches to using a regex that only matches the current argument, and then makes sure to split the input string using structural sharing of the backing char[] (by using `CharSequence.subsequence`, rather than high level Scala collections operations from `StringLike`). After this change, I no longer observed this area of code in the top profiler results.
retronym
added a commit
to retronym/scala
that referenced
this issue
May 15, 2017
Echoing the performance bug in the bash scripts (scala/bug#9279), the command line parser exhibited exponential performance. When using the command line arguments used to compile the standard library, which contains ~ 700 source files, I noticed about 1% of compilation time was being spend in evaluating the regex `(\S+)(.*)`. Inspection of the parser reveals that this was repeatedly being called on the rest of the command line as the parser consumed each argument. This commit switches to using a regex that only matches the current argument, and then makes sure to split the input string using structural sharing of the backing char[] (by using `String.substring`, rather than high level Scala collections operations from `StringLike#span`). After this change, I no longer observed this area of code in the top profiler results.
retronym
added a commit
to retronym/scala
that referenced
this issue
May 15, 2017
Echoing the performance bug in the bash scripts (scala/bug#9279), the command line parser exhibited exponential performance. When using the command line arguments used to compile the standard library, which contains ~ 700 source files, I noticed about 1% of compilation time was being spend in evaluating the regex `(\S+)(.*)`. Inspection of the parser reveals that this was repeatedly being called on the rest of the command line as the parser consumed each argument. This commit switches to using a regex that only matches the current argument, and then makes sure to split the input string using structural sharing of the backing char[] (by using `String.substring`, rather than high level Scala collections operations from `StringLike#span`). After this change, I no longer observed this area of code in the top profiler results.
retronym
added a commit
to retronym/scala
that referenced
this issue
May 15, 2017
Echoing the performance bug in the bash scripts (scala/bug#9279), the command line parser exhibited exponential performance. When using the command line arguments used to compile the standard library, which contains ~ 700 source files, I noticed about 1% of compilation time was being spend in evaluating the regex `(\S+)(.*)`. Inspection of the parser reveals that this was repeatedly being called on the rest of the command line as the parser consumed each argument. This commit switches to using a regex that only matches the current argument, and then makes sure to split the input string using structural sharing of the backing char[] (by using `String.substring`, rather than high level Scala collections operations from `StringLike#span`). After this change, I no longer observed this area of code in the top profiler results.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Analysis https://gist.github.com/retronym/3be212b836de6537cc1b
The text was updated successfully, but these errors were encountered: