[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Luajit and curstom data structures
- From: Adam Strzelecki <ono@...>
- Date: Thu, 14 Apr 2011 12:48:12 +0200
> So, my request for C API was logical if we think in term of the old
> Lua C function but if you adopt the new FFI paradigm you don't need
> the C API anymore, you just write Lua code and directly call C
> functions when needed.
Correct me if I am wrong, but I think FFI really improves performance, since it can optimally couple internal Lua variable representation with function call rather than doing regular parameters/stack packing known from C wrapper modules which means extra utility function calls.
For example calling C "double cos(double x)" with FFI should have same performance as calling it in C language using native types, since anyway LuaJIT uses doubles internally, so it can pass the parameters without almost no checking, no type conversion. At least this is what I expect and believe :)
Regards,
--
Adam Strzelecki
- References:
- Luajit and curstom data structures, KR
- Re: Luajit and curstom data structures, Mike Pall
- Re: Luajit and curstom data structures, KR
- Re: Luajit and curstom data structures, Mike Pall
- Re: Luajit and curstom data structures, Mike Pall
- Re: Luajit and curstom data structures, Francesco Abbate
- Re: Luajit and curstom data structures, Mike Pall
- Re: Luajit and curstom data structures, Francesco Abbate
- Re: Luajit and curstom data structures, Javier Guerra Giraldez
- Re: Luajit and curstom data structures, Francesco Abbate