Skip to content

Set compiler options when compiling Dotty in benchmarks #14670

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

Merged
merged 1 commit into from
Mar 14, 2022

Conversation

mbovel
Copy link
Member

@mbovel mbovel commented Mar 11, 2022

The dotty benchmark (that measure the time it takes to compile dotty itself) fails since #4533 because of missing language features like:

-- Error: /home/bench/bench/dotty/compiler/src/dotty/tools/backend/jvm/BytecodeWriters.scala:103:61 
103 |      val asmpFile = segments.foldLeft(baseDir: Path)(_ / _) changeExtension "asmp" toFile;
      |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |postfix operator `toFile` needs to be enabled
      |by making the implicit value scala.language.postfixOps visible.
      |----
      |This can be achieved by adding the import clause 'import scala.language.postfixOps'
      |or by setting the compiler option -language:postfixOps.
      |See the Scaladoc for value scala.language.postfixOps for a discussion
      |why the feature needs to be explicitly enabled.

This is due to the removal of the import scala.language.{postfixOps, implicitConversions} imports in #4533. This does not matter when compiling from SBT as -language:existentials,higherKinds,implicitConversions,postfixOps is set in Build.scala, but fails when compiling from the benchmarks where these options are not set. This PR fixes it by using the same options for compiling dotty in the benchmark as these set in Build.scala.

Setting these options does not significantly impact the running time of the benchmark:

# Run progress: 0.00% complete, ETA 00:00:50
# Fork: 1 of 1
# Warmup Iteration   1: 93333.096 ms/op
# Warmup Iteration   2: 51658.465 ms/op
# Warmup Iteration   3: 48529.844 ms/op
# Warmup Iteration   4: 45069.616 ms/op
# Warmup Iteration   5: 44276.632 ms/op
# Warmup Iteration   6: 44249.543 ms/op
# Warmup Iteration   7: 43832.332 ms/op
# Warmup Iteration   8: 45169.822 ms/op
# Warmup Iteration   9: 44017.520 ms/op
# Warmup Iteration  10: 43512.763 ms/op
# Warmup Iteration  11: 44010.859 ms/op
# Warmup Iteration  12: 43260.302 ms/op
# Warmup Iteration  13: 44645.430 ms/op
# Warmup Iteration  14: 43335.751 ms/op
# Warmup Iteration  15: 43365.219 ms/op
# Warmup Iteration  16: 43878.094 ms/op
# Warmup Iteration  17: 43102.525 ms/op
# Warmup Iteration  18: 44902.818 ms/op
# Warmup Iteration  19: 43228.540 ms/op
# Warmup Iteration  20: 43254.206 ms/op
# Warmup Iteration  21: 43861.114 ms/op

@mbovel
Copy link
Member Author

mbovel commented Mar 11, 2022

test performance please

@dottybot
Copy link
Member

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

@mbovel mbovel requested a review from anatoliykmetyuk March 11, 2022 18:32
@mbovel
Copy link
Member Author

mbovel commented Mar 11, 2022

Might want to set -Yexplicit-nulls as well as it is set here:

https://github.com/lampepfl/dotty/blob/895598fbe4f0c44c996686fb7885946bfa063099/project/Build.scala#L772

@mbovel mbovel marked this pull request as ready for review March 11, 2022 18:35
@dottybot
Copy link
Member

Performance test finished successfully:

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

Benchmarks is based on merging with main (895598f)

@anatoliykmetyuk anatoliykmetyuk merged commit 57d2f37 into scala:main Mar 14, 2022
@anatoliykmetyuk anatoliykmetyuk deleted the mb/fix-dotty-bench branch March 14, 2022 09:46
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.

3 participants