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

Space: Cache isSubspace for a 3000% speedup #13637

Merged
merged 1 commit into from Dec 2, 2021

Conversation

dwijnand
Copy link
Member

No description provided.

@dwijnand dwijnand linked an issue Sep 29, 2021 that may be closed by this pull request
@dwijnand dwijnand marked this pull request as ready for review September 29, 2021 20:14
@dwijnand
Copy link
Member Author

Who's interested and/or good at performance? I've seen commits and hears @odersky speak about doing some. Also @liufengyun might have some feedback specific to the space engine in general. Review feedback welcome.

@liufengyun
Copy link
Contributor

It's nice to improve performance 👍 I'd suggest adding the test to benchmarks, and also run a bench test to see how it helps existing bench tests related to exhaustivity.

@dwijnand
Copy link
Member Author

dwijnand commented Oct 6, 2021

I'd suggest adding the test to benchmarks

I've not looked at the benchmarks? What am I adding and how? And is that instead of the existing test or in addtion?

also run a bench test to see how it helps existing bench tests related to exhaustivity

Do I need to have write access to the staging repo to create a branch there to do that still? And what's the next step after that? Sorry... this would be my first time playing the benchmarking game in the dotty repo.

@liufengyun
Copy link
Contributor

I'd suggest adding the test to benchmarks

I've not looked at the benchmarks? What am I adding and how? And is that instead of the existing test or in addtion?

also run a bench test to see how it helps existing bench tests related to exhaustivity

Do I need to have write access to the staging repo to create a branch there to do that still? And what's the next step after that? Sorry... this would be my first time playing the benchmarking game in the dotty repo.

You can add a new exhaustivity check benchmark in the following file:

https://github.com/lampepfl/dotty/blob/master/bench/profiles/exhaustivity.yml

And then tell the bot to run the bench test with a comment like test performance with #exhaustivity please. When the test finishes, the bot will send a link to the test result.

I'm not sure if you need to push to staging repo (you can first try without doing that). You will definitely need to add yourself to be known to the bot here:

https://github.com/lampepfl/bench/blob/master/bin/process#L22

@bishabosha
Copy link
Member

test performance with #exhaustivity please

@liufengyun
Copy link
Contributor

It seems the Bot is not running, the same in #13715

@anatoliykmetyuk
Copy link
Contributor

test performance with #exhaustivity please

@dottybot
Copy link
Member

performance test scheduled: 1 job(s) in queue, 1 running.

@anatoliykmetyuk anatoliykmetyuk removed their assignment Oct 12, 2021
@dottybot
Copy link
Member

Performance test finished successfully:

Visit https://dotty-bench.epfl.ch/13637/ to see the changes.

Benchmarks is based on merging with master (1ed25ce)

@liufengyun
Copy link
Contributor

The numbers look nice 👍

Regarding the implementation, I'd suggest trying caching the subtyping --- if the numbers are similar, caching for subtyping is better.

@dwijnand
Copy link
Member Author

dwijnand commented Dec 2, 2021

Regarding the implementation, I'd suggest trying caching the subtyping --- if the numbers are similar, caching for subtyping is better.

Caching the subtyping seems to be much worst:

$ qsc3 tests/pos/i13565.scala
[info] entering *experimental* thin client - BEEP WHIRR
[info] terminate the server with `shutdown`
> scalac -pagewidth 207  tests/pos/i13565.scala
[info] compiling 1 Scala source to /d/scala3/compiler/target/scala-3.1.1-RC1/classes ...
[info] running (fork) dotty.tools.dotc.Main -classpath /Users/dnw/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.6/scala-library-2.13.6.jar:/d/scala3/library/../out/bootstrap/scala3-library-bootstrapped/scala-3.1.2-RC1-bin-SNAPSHOT-nonbootstrapped/scala3-library_3-3.1.2-RC1-bin-SNAPSHOT.jar -pagewidth 207 tests/pos/i13565.scala
[success] Total time: 153 s (02:33), completed Dec 2, 2021 9:13:37 AM
$ git co .
Updated 1 path from the index
$ qsc3 tests/pos/i13565.scala
[info] entering *experimental* thin client - BEEP WHIRR
[info] terminate the server with `shutdown`
> scalac -pagewidth 207  tests/pos/i13565.scala
[info] compiling 1 Scala source to /d/scala3/compiler/target/scala-3.1.1-RC1/classes ...
[info] running (fork) dotty.tools.dotc.Main -classpath /Users/dnw/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.6/scala-library-2.13.6.jar:/d/scala3/library/../out/bootstrap/scala3-library-bootstrapped/scala-3.1.2-RC1-bin-SNAPSHOT-nonbootstrapped/scala3-library_3-3.1.2-RC1-bin-SNAPSHOT.jar -pagewidth 207 tests/pos/i13565.scala
[success] Total time: 7 s, completed Dec 2, 2021 9:14:56 AM

Happy to approve this?

Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@dwijnand dwijnand merged commit 6b1a662 into scala:master Dec 2, 2021
@dwijnand dwijnand deleted the perf/exhaust branch December 2, 2021 22:42
@Kordyjan Kordyjan added this to the 3.1.2 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

abnormal long compilation time of match over case classes structure
8 participants