- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.1k
Remove local optimizations #4799
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
Conversation
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
    22d9046    to
    131b8e9      
    Compare
  
    There was a problem hiding this 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
| val yCheckOptions = Array("-Ycheck:all") | ||
|  | ||
| val basicDefaultOptions = checkOptions ++ noCheckOptions ++ yCheckOptions | ||
| val defaultUnoptimised = TestFlags(classPath, runClassPath, basicDefaultOptions) | 
There was a problem hiding this comment.
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
f5e63a7    to
    a408a03      
    Compare
  
    | @liufengyun Can you update the benchmarks once this is merged? | 
After scala/scala3#4799, a build spawns 2 jobs instead of 3. So we can increase the number of parallel builds.
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