-
Notifications
You must be signed in to change notification settings - Fork 21
More integer allocations from StringLike#times after scala 2.12.8 upgrade #11547
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
Comments
I don't know if the behavior changed in 2.12, but if you're concerned about range allocation, it's been fixed in 2.13 as scala/scala#6535. Unless there's something actionable, I think we should close this issue before it gets buried and forgotten. |
(someone motivated could look into whether a 2.12.x backport is feasible) |
Hi Scala team, I am able to reproduce it by running a micro benchmark, it turns out that this may not be related to the depth of the stack trace. Below is a copy of the Do you think this is fixed in Scala 2.13? Scala 2.12.8
Scala 2.11.12
To reproduce:
|
For the record, the supplied benchmark shows that 2.13 improves on 2.11. The performance problem on 2.12 is that it no longer inlined specialized
The second one is https://scalapuzzlers.com/#pzzlr-027 I wonder if there is a lint for that yet. |
Hi Scala team,
We did a recent upgrade from scala 2.11.12 to 2.12.8, and we noticed that by running on 2.12.8 library, a lot more integers are allocated from calling
StringLike#times
method on top of a high stack trace(the stack trace we have seen by running async profiler has 46 levels, please see attachment 1).However, when we try to run bench marks of just the
times
method in scala 2.11.12 and scala 2.12.8, scala 2.12.8 gave slightly better allocation rate and no integers allocated from running async profiler(please see attachment 2). This issue only happens when thetimes
method is called at the end of a high stack trace.Do you have any insights on what might cause this issue?
Thanks,
Jing
Attachment 1: Allocation profiling from calling
StringLike#times
class on top of a high stack trace(by Async Profiler)Attachment 2: Scala 2.11.12 vs. Scala 2.12.8 allocation profiling of calling
StringLike#times
alone(by Async Profiler)[Scala 2.11.12]
[Scala 2.12.8]
The text was updated successfully, but these errors were encountered: