[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Trying Pallene
- From: Eric Wing <ewmailing@...>
- Date: Tue, 11 Oct 2022 15:00:30 -0700
On 10/11/22, Pierre Chapuis <lua@catwell.info> wrote:
> I won't publish this code (at least not now) but porting from Teal was
> straightforward - basically replacing instances of "number" with "float" and
> tweaking a few things. I just had to add a small Teal type signature file
> (.d.tl) so I can call the Pallene code from Teal. This straightforward port
> gave me a 4x speedup (compared to Teal but that is basically plain Lua).
>
Coincidentally, I just posted results of a little benchmark for my
program in the Pallene discussion section on Github. I've been
experimenting with Pallene for the last year on a side-project (as
time permits). The program is a back tester for stocks and options
strategies. As such, the program is mostly iterating through arrays of
floats and doing simple math on the numbers, with a lot of control
flow stuff to implement specific trading strategies.
Here are the results from Lua 5.4, LuaJIT, and Pallene.
Lua 5.4
real 37m43.191s
user 35m22.021s
sys 0m0.568s
LuaJIT 2.1.0-beta3:
real 20m13.698s
user 17m9.879s
sys 0m43.243s
Pallene:
real 11m33.475s
user 9m11.986s
sys 0m0.511s
I know Pallene isn't trying to beat LuaJIT, but I was impressed with
this result. I don't know why my program worked out this way. If I had
to guess as to the reason, the program is complicated enough that it
is probably hard to unroll and vectorize a lot of things, and probably
a the majority of the time is dealing with the control flow.
I also find this result encouraging for Pallene because I think my
program is probably more reflective of programs that will be written
in the real world, and not a micro-benchmark. My hope is that a lot of
regular programs will enjoy similar performance benefits.
I have a variant of the above run that utilizes Lua Lanes, but I was
unable to use it for this benchmark because I was getting segmentation
faults with (only) LuaJIT on that code. This might be another subtle
advantage for Pallene because I have no idea how to debug this kind of
problem with LuaJIT.