-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Try some optimizations #4448
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
Try some optimizations #4448
Conversation
test performance please |
performance test scheduled: 1 job(s) in queue, 0 running. |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/4448/ to see the changes. Benchmarks is based on merging with master (d0f7846) |
test performance please: a1ce848 |
performance test scheduled for a1ce848: 1 job(s) in queue, 0 running. |
@odersky it's possible to give multiple commits separated by space. |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/4448-1/ to see the changes. Benchmarks is based on merging with master (48a2f4b) |
tests/run/lst/Lst.scala
Outdated
def head: T = apply(0) | ||
def last: T = apply(length - 1) | ||
|
||
def headOr[U >: T](alt: => U): U = if (length == 0) alt else head |
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.
if (isEmpty) alt else head
test performance please |
performance test scheduled: 1 job(s) in queue, 0 running. |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/4448-2/ to see the changes. Benchmarks is based on merging with master (48a2f4b) |
In readLater the context is not preserved, but reconstituted using the owner of the context building the closure. We need to pass the mode as well, or else ReadPositions might be reset. I noticed this when I saw that positions were not read correctly when inlining.
…nitions This was done by accident before, because we did not keep the mode bits of the context calling a readLater.
When printing trees, modifiers were always taken from the tree. This is wrong for typed trees, since their flags and annotations come from the symbol, the tree modifiers are no longer relevant.
Was forgotten before, which meant that labels were forgotten in inlined code. The code was still correct, but a method would be created for each label.
Rebased sur #4464. |
Dealias them and try again.
The idea is to have a compiler-specific list data type that optimizes for small lists. Where the overhead of normal lists is one Cons node per element, the overhead of `Lst` is 0 for lists of length <= 1, and 1 array node for longer lists. Furthermore, we'll try to inline heavily, which is easier for specialized data structures. The main downsides are inefficient `tail` and `::`, in particular for longer lists. Compiler code will need to be adapted to avoid these where it is performance critical. This also serves as test case for the inline related fixes in the previous commits.
Direct encoding of lazy val I also tried to mase typeParams tail recursive by addling a local `recur` method. But it turns out the previous typeParams is already fully optimized, no need to add a local function.
test performance please |
performance test scheduled: 1 job(s) in queue, 1 running. |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/4448-2/ to see the changes. Benchmarks is based on merging with master (6f6816d) |
test performance please |
performance test scheduled: 3 job(s) in queue, 1 running. |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/4448-2/ to see the changes. Benchmarks is based on merging with master (ddf10a2) |
Mostly in TypeErasure and MixinOps, plus derived code. Also: remove stray println.
test performance please |
performance test scheduled: 7 job(s) in queue, 1 running. |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/4448-2/ to see the changes. Benchmarks is based on merging with master (80764e0) |
The fixes in this PR have been integrated in master. As far as optimizations go, the small ones did not help and for The updated |
This branch tries out some low-level optimizations. It also contains
Fix:
commits which are fixes of problems discovered.