Re: Projects I may be willing to sponsor - FFI Array Sum versus native table results

  • From: Joe Ellsworth <joexdobs@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 10 Dec 2014 15:25:22 -0800

I have to disagree on what it proves. Our ML application happens to do just this kind of sum millions of times it may be indexing into 25 different versions of very similar arrays but the concept remains very similar. In this instance it happened to prove that it probably is not worth the overhead of using the FFI array but if it had saved 20% then it could have a profound impact on total run time.


On 12/10/2014 3:07 PM, Mike Pall wrote:
Joe Ellsworth wrote:
That is super cool.  I would never have come up with the casting
trick from the examples currently on the site.
But it's not helpful advice. It does NOT make sense to create
scalar cdata values. Since the native number type of Lua is a
double, all cdata doubles are eventually converted (on access or
arithmetic operations) to Lua numbers, anyway.

Also, please ... everyone ... use local variables in benchmarks.

Umm, and ... this benchmark proves very little. And it doesn't
help in deciding for a toolchain at all, unless the targeted
application does exactly one thing: summing up an array of doubles
in the L3 cache (<8MB). It's only measuring cache bandwidth,
nothing else.

--Mike



Other related posts: