Re: FFI array performance

  • From: Mike Pall <mike-1205@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Fri, 25 May 2012 22:12:45 +0200

Simon Cooke wrote:
> I've been trying out the FFI library recently, and have tested the
> variable-length array feature with mixed performance results. For
> native types (e.g. float, double) it works very efficiently, but for
> simple structs the performance drops dramatically, by ~ 50x.

http://luajit.org/ext_ffi_semantics.html#status

  [...]
  The following operations are currently not compiled and may
  exhibit suboptimal performance, especially when used in inner
  loops:

  * Array/struct copies and bulk initializations.
  [...]

> Is this
> to be expected, or is it something that might be possible to fix?

  The initial release of the FFI library has some limitations and
  is missing some features. Most of these will be fixed in future
  releases. [...]

--Mike

Other related posts: