Hi, I prepared a PR with additional tests for the ...
# arrow-contributors
p
Hi, I prepared a PR with additional tests for the Free package; and, I added a new benchmarking project for the trampoline part... Interesting: for calculations of the Fibonacci sequence, there is approximately 30% difference between the Trampoline/Eval approaches.
👏 1
Note : I will push this PR as soon as one of my proxies will be available 😡
p
30% improvement? wow!
p
30% in favour of Eval... I only added some additional tests.
j
Does your benchmark rerun the computation with the same
Eval
multiple times? Because
Eval
memoizes results in some cases
I actually use that quite heavily in my prettyprinter because the same lazy structure gets traversed over and over again
p
yep, you're right... I think that jmh reuses the same resource
j
You can set an isolation level per invocation afaik
p
I used Scope.Thread as isolation... I think that I can play with the Setup annotation... I will check again
r
We need to investigate what we can do at a compiler plugin level to support trampolining automatically without building up data structures
j
This leads into control flow analysis and predicting stack depth, which is really hard. Unless you trampoline everything, which may or may not hurt performance, but that's worth testing.
I think looking at the leanest structure possible is important. And between
AndThen
,
Eval
,
Trampoline
and
IO
I think that may be
AndThen
because it fuses function calls.
AndThen
however will still cause overflows if it is invoked at depth.
Eval
and
Trampoline
both trampoline everything and thus don't need this.
IO
is usually invoked at the edge and hence can fuse function calls freely because of that.
@PhBastiani can you try
AndThen
in your tests as well? Would be interested in the outcome ^^