-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Implement Tuple operation directly in the compiler #6539
Implement Tuple operation directly in the compiler #6539
Conversation
test performance with #tuples please |
performance test scheduled: 1 job(s) in queue, 0 running. |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/6539/ to see the changes. Benchmarks is based on merging with master (fb6667b) |
b12df61
to
ab85854
Compare
test performance with #tuples please |
performance test scheduled: 1 job(s) in queue, 1 running. |
test performance with #tuples please |
performance test scheduled: 1 job(s) in queue, 1 running. |
05eaa84
to
68babe3
Compare
test performance with #tuples please |
performance test scheduled: 1 job(s) in queue, 1 running. |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/6539/ to see the changes. Benchmarks is based on merging with master (3bcaf1d) |
09b778f
to
f677b4c
Compare
test performance with #tuples please |
performance test scheduled: 1 job(s) in queue, 1 running. |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/6539/ to see the changes. Benchmarks is based on merging with master (59e910a) |
5deb7e7
to
40b741c
Compare
test performance with #tuples please |
performance test scheduled: 1 job(s) in queue, 1 running. |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/6539/ to see the changes. Benchmarks is based on merging with master (ba6a973) |
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.
Looks good overall. Just some minor changes needed.
compiler/src/dotty/tools/dotc/transform/TupleOptimizations.scala
Outdated
Show resolved
Hide resolved
compiler/src/dotty/tools/dotc/transform/TupleOptimizations.scala
Outdated
Show resolved
Hide resolved
compiler/src/dotty/tools/dotc/transform/TupleOptimizations.scala
Outdated
Show resolved
Hide resolved
Improves the state of scala#6524. Instead of convering all tuples to arrays and performing the operations on them, we take advantage of the fact that those Tuples are products and have productIterators. Implementations of tail, *: and ++ on iterators do not require extra collentions to be created, hence it is also probably more performant at runtime.
To increase the performance of compiling code with Tuple/NonEmptyTuple operations
515069d
to
e7a969f
Compare
Rebased |
3ba4b07
to
950ead1
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.
Just one more tweak and this is good to go.
In this PR we gain performance of compiling code with tuple operations. The improvements are split into two.
First, introduce some optimizations on the generated code to avoid generating code that is too large.
Second, implement all optimizations and check in the new
TupleOptimizations
miniphase. It performs the equivalent optimizations as the first part. It expands the later in the compilation pipeline which saves time in phases beforeTupleOptimizations
(placed just beforeErasure
).