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

Implement Tuple operation directly in the compiler #6539

Merged
merged 11 commits into from
Jun 6, 2019

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented May 21, 2019

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 before TupleOptimizations (placed just before Erasure).

@nicolasstucki nicolasstucki changed the title Tuple codegen in compiler Implement Tuple operation directly in the compiler May 21, 2019
@nicolasstucki
Copy link
Contributor Author

test performance with #tuples please

@dottybot
Copy link
Member

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

@dottybot
Copy link
Member

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/6539/ to see the changes.

Benchmarks is based on merging with master (fb6667b)

@nicolasstucki nicolasstucki force-pushed the tuple-codegen-in-compiler branch 6 times, most recently from b12df61 to ab85854 Compare May 21, 2019 15:44
@nicolasstucki
Copy link
Contributor Author

test performance with #tuples please

@dottybot
Copy link
Member

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

@nicolasstucki
Copy link
Contributor Author

test performance with #tuples please

@dottybot
Copy link
Member

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

@nicolasstucki nicolasstucki force-pushed the tuple-codegen-in-compiler branch from 05eaa84 to 68babe3 Compare May 21, 2019 16:50
@nicolasstucki
Copy link
Contributor Author

test performance with #tuples please

@dottybot
Copy link
Member

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

@dottybot
Copy link
Member

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/6539/ to see the changes.

Benchmarks is based on merging with master (3bcaf1d)

@nicolasstucki nicolasstucki force-pushed the tuple-codegen-in-compiler branch 5 times, most recently from 09b778f to f677b4c Compare May 23, 2019 06:17
@nicolasstucki
Copy link
Contributor Author

test performance with #tuples please

@dottybot
Copy link
Member

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

@dottybot
Copy link
Member

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/6539/ to see the changes.

Benchmarks is based on merging with master (59e910a)

@nicolasstucki nicolasstucki force-pushed the tuple-codegen-in-compiler branch from 5deb7e7 to 40b741c Compare May 23, 2019 08:10
@nicolasstucki nicolasstucki marked this pull request as ready for review May 23, 2019 08:38
@nicolasstucki
Copy link
Contributor Author

test performance with #tuples please

@dottybot
Copy link
Member

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

@dottybot
Copy link
Member

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/6539/ to see the changes.

Benchmarks is based on merging with master (ba6a973)

@nicolasstucki nicolasstucki requested review from OlivierBlanvillain and removed request for odersky May 28, 2019 15:41
Copy link
Contributor

@odersky odersky left a 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.

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
@nicolasstucki nicolasstucki force-pushed the tuple-codegen-in-compiler branch from 515069d to e7a969f Compare June 5, 2019 18:30
@nicolasstucki
Copy link
Contributor Author

Rebased

@nicolasstucki nicolasstucki force-pushed the tuple-codegen-in-compiler branch from 3ba4b07 to 950ead1 Compare June 6, 2019 05:47
Copy link
Contributor

@odersky odersky left a 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.

@odersky odersky assigned nicolasstucki and unassigned odersky Jun 6, 2019
@nicolasstucki nicolasstucki merged commit 33ad06b into scala:master Jun 6, 2019
@nicolasstucki nicolasstucki deleted the tuple-codegen-in-compiler branch June 6, 2019 08:04
@biboudis biboudis added this to the 0.16 Tech Preview milestone Jun 7, 2019
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.

5 participants