-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #1619: Reduce collision rate in NameTable (II) #1727
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
Conversation
Since the aim of the PR is speed it would be good to see benchmarks that show how it compares to the baseline. How much faster is ScalaTest compilation with the change? Do we see a slowdown elsewhere? |
Jason did some benchmarks here: scala/scala-dev#246 (comment). He only found a negligible (+2ms) increase for normal libraries like better-files. If you think it would be interesting to do the benchmarks for Dotty, I'm happy to double-check the results are the same. |
I haven't merged this change yet into scala/scala because one of my benchmarks (compiling scalap) seemed to slow down by 1%. I haven't had time to dive into this result to see what's going on. ScalaTest performs a self-test by generating tonnes of code to compile that exercise different combinations of ScalaTest base classes, testing DSLs, etc. A combination of factors led to the pathological case:
|
Yes, I think it would be good to do the benchmarks for dotty. Also, the question is whether we see a slowdown for ScalaTest. The specific cases that Jason noted which ruin hashcodes for scalac are not present in dotty. |
Perfect, will submit the results. |
Incidentally, the string table in HotSpot VM (for storing names of classes, methods, etc) uses the equivalent of |
Will benchmarks be forthcoming? If not we should close. |
Yes, I'm working on them. Will report soon. |
OK thanks!
…On Sat, Dec 17, 2016 at 6:44 PM, Jorge ***@***.***> wrote:
Yes, I'm working on them. Will report soon.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1727 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAwlVhlFXBsaFznW9t_6G3FmZhYrnqsHks5rJB9igaJpZM4K3pwM>
.
{"api_version":"1.0","publisher":{"api_key":"
05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":
{"external_key":"github/lampepfl/dotty","title":"
lampepfl/dotty","subtitle":"GitHub repository","main_image_url":"
https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-
11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://
cloud.githubusercontent.com/assets/143418/15842166/
7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in
GitHub","url":"https://github.com/lampepfl/dotty"}},"
***@***.*** in #1727: Yes,
I'm working on them. Will report soon."}],"action":{"name":"View Pull
Request","url":"#1727 (comment)
267776092"}}}
--
Prof. Martin Odersky
LAMP/IC, EPFL
|
The fix is consistent with Scalac: https://github.com/scala/scala/pull/5474/files.
Now we have a JMH-based Dotty benchmarking tool to add community projects and benchmark them as I will explain the benchmark results of this change very soon, I need to have a careful look to the numbers. |
These are the results of the benchmarks for squants and better-files. They were run in a Linux 4.8.13-1 with an Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz with TurboBoost disabled, 16GB of RAM and no swapping. The results tell that this change slightly slows down the compilation for cold compilations of better-files and squants and behaves "similarly" for warmed JVMs. Both are ~1 second slower in cold start but get better results in hot JVMs (results differ from slightly slower to slightly faster depending on the percentile). These are the jmh options used. Unfortunately, we cannot compile scalap yet. I think that scalap would throw more interesting results since it is the only library to which this change has had some impact in scalac. Judging by what we have right now, I think that it's maybe better to close this and revisit it in the future when performance fixes are more required. This one is not very favourable to Dotty and I'm unsure we'll ever need it... |
Thanks for the detailed results @jvician! This is very helpful. What's the problem compiling scalap? Can we fix it? In that case I would propose to leave this issue open until we have can test with scalap. |
@odersky I made some tweaks in scalap to make it compile (there were 16 compilation failures IIRC). I think I removed all of them but Dotty then threw a pickling exception -- for some reason, Dotty was failing to unpickle the symbol of a type parameter |
The fix is consistent with Scalac: https://github.com/scala/scala/pull/5474/files.