-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Improve performance of tuple operations #7689
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
Conversation
test performance with #tuple-runtime : 0a33ad3 |
|
You may have found a bug in the compiler. I would suggest using git bisect to find the commit where it started failing. |
Ok, I will do this. |
I identified the commit where it starts failing, it is e1a01d2. It probably has something to do with polymorphic lambdas so I will try to see if I can fix it. |
Ok, the problem was coming from |
Should we try to test the performance using the profile |
test performance with #tuple-runtime |
performance test scheduled: 2 job(s) in queue, 1 running. |
@liufengyun did the benchmark run? |
There is a bug report lampepfl/bench#47 . However, I couldn't find any logs. I just rescheduled the job. |
Currently, it does not support profile names with a hyphen.
I renamed |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/7689/ to see the changes. Benchmarks is based on merging with master (0e761ea) |
Ok, thanks for fixing it, I didn't know about the hyphen limitation ! |
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.
Otherwise LGTM
@liufengyun could you execute these benchmarks on master? |
@liufengyun Is it possible to run them on both branches, to have a comparison in the same graph ? Thanks ! |
Now they are added to the default profile: lampepfl/bench@2acb4ef |
test performance with #tupleRuntime: master 08613cb |
performance test scheduled for master 08613cb: 2 job(s) in queue, 1 running. |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/7689/ to see the changes. Benchmarks is based on merging with master (e036f46) |
In this pull request, I made some extensive benchmarks of the current tuple operations (cons, concat, tail, map, zip, ...). I analyzed their performance and tried to understand what were the bottlenecks of the current implementation, and improved them.
Not surprisingly, it turns out that the most efficient way to implement them is to avoid conversions between tuple, iterators and arrays as much as possible because this is the main source of overhead.
For Tuple1 to Tuple22, making a big match on the tuple arity is what gives the best performance (but very ugly code unfortunately).
For TupleXXL, performing the operation on the array seems to be the way to go.
See @nicolasstucki, my semester project supervisor, for more information.