Skip to content
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

Introduce a new implementation of implicit shadowing #49

Closed
wants to merge 2 commits into from

Conversation

retronym
Copy link
Owner

Avoid building up a set of all in-scope implicits during each implicit
search.

Instead, do the filtering of shadowed implicits in a second pass.

@retronym
Copy link
Owner Author

Related to: scala#7757

@retronym
Copy link
Owner Author

TODO:

  • Benchmark this. Running the Akka build through PipelineMain is a good stress test as it uses loads of implicits for ScalaTest's DSL.

@retronym retronym changed the title Introduce a new implenentation of implicit shadowing Introduce a new implementation of implicit shadowing May 28, 2019
@retronym retronym closed this May 28, 2019
@retronym retronym reopened this May 28, 2019
@retronym retronym force-pushed the topic/rework-implicit-shadower branch 2 times, most recently from 23aac97 to e5d2f52 Compare May 29, 2019 05:28
@retronym
Copy link
Owner Author

retronym commented May 29, 2019

Measuring allocation rate improvements:

$ sbt 'set scalaVersion in compilation := "'$V'"' 'hot -psource=@/code/akka/akka-stream-tests/target/akka-stream-tests-test.args -pextraArgs=-Ystop-after:typer -f1 -prof gc -wi 4 -i 4'

Baseline

[info] HotScalacBenchmark.compile:·gc.alloc.rate.norm                       ../corpus           latest  -Ystop-after:typer       false  2.12.9-bin-c35194d-SNAPSHOT  @/code/akka/akka-stream-tests/target/akka-stream-tests-test.args  sample    4  1654953148.000 ±   10829315.614    B/op

New:

[info] HotScalacBenchmark.compile:·gc.alloc.rate.norm                       ../corpus           latest  -Ystop-after:typer       false  2.12.9-bin-e5d2f52-SNAPSHOT  @/code/akka/akka-stream-tests/target/akka-stream-tests-test.args  sample    4  1496569959.000 ±    5947894.601    B/op

0.90x reduction.

@retronym retronym force-pushed the topic/rework-implicit-shadower branch from e5d2f52 to cf5d0fb Compare May 29, 2019 06:18
Avoid building up a set of all in-scope implicits during each
implicit search.

Instead, do the filtering of shadowed implicits in a second
pass.
With an opt-out system property
@retronym retronym force-pushed the topic/rework-implicit-shadower branch from cf5d0fb to 3d1ab81 Compare May 29, 2019 06:20
@retronym
Copy link
Owner Author

Promoted to scala#8109

@retronym retronym closed this May 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant