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

Remove local optimizations #4799

Merged
merged 3 commits into from
Jul 18, 2018

Conversation

OlivierBlanvillain
Copy link
Contributor

This PR removes the local optimizations, as discussed in the last meeting. To summarize:

  • The performance improvements are too small (and inconsistent) compared to the additional compilation cost

  • With the plan to reuse the scalac backend in dotty, it makes little sense to have similar optimizations earlier in the pipeline

  • We are currently spending 1/3 of the CI time on testing this code

@OlivierBlanvillain OlivierBlanvillain changed the title Remove local optimizations 🔥 Remove local optimizations Jul 18, 2018
Here are the results, each experiment consists of 40 forks of 10 warmups
and 20 measurements each (that's what it takes to get ~30ms precision!):

ConstantFold                12672.914 ± 29.044  ms/op
InlineLocalObjects          12742.463 ± 29.693  ms/op
DropNoEffects               12717.516 ± 28.266  ms/op
DropGoodCasts               12753.709 ± 31.020  ms/op
Jumpjump                    12758.874 ± 28.979  ms/op
Devalify                    12820.393 ± 29.601  ms/op
Valify                      12732.851 ± 29.466  ms/op
InlineOptions               12705.638 ± 29.186  ms/op
RemoveUnnecessaryNullChecks 12740.366 ± 29.604  ms/op
InlineCaseIntrinsics        12675.068 ± 29.075  ms/op
Not Optimized               12731.068 ± 28.731  ms/op
All Optimizations           12762.053 ± 28.751  ms/op

Also here a count of how many time each optimization modifies a tree
when bootstrapping (running all of them together):

20688 Devalify
 7165 DropNoEffects
 2787 InlineCaseIntrinsics
 1340 ConstantFold
  728 DropGoodCasts
   76 InlineOptions
   49 InlineLocalObjects
   16 RemoveUnnecessaryNullChecks
    3 Jumpjump

Here are some additional numbers obtained using the Scala Native
benchmarks:

https://plot.ly/~olivierblanvillain/1/#plot
Copy link
Contributor

@allanrenucci allanrenucci left a comment

Choose a reason for hiding this comment

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

You should also move all the tests in {pos,neg,run}-no-optimise.

You will need to update docs/sidebar.yml by removing the references to the doc you removed

@@ -49,7 +49,6 @@ object TestConfiguration {

val basicDefaultOptions = checkOptions ++ noCheckOptions ++ yCheckOptions
val defaultUnoptimised = TestFlags(classPath, runClassPath, basicDefaultOptions)
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename defaultOptions?

Also remove defaultUnoptimised
@allanrenucci
Copy link
Contributor

@liufengyun Can you update the benchmarks once this is merged?

@allanrenucci allanrenucci merged commit 58e387f into scala:master Jul 18, 2018
allanrenucci added a commit to lampepfl/dotty-ci that referenced this pull request Jul 18, 2018
After scala/scala3#4799, a build spawns 2 jobs instead of 3. So we can increase the number of parallel builds.
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.

2 participants