lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


The ZeroMQ [1] bindings [2] just got faster using LuaJIT2 FFI support.  
Another important feature of these new bindings is that they still work 
without FFI support, so the same .so module can be used with the standard Lua 
VM or with LuaJIT2.  This hybrid module has been created with the help of my 
LuaNativeObjects [3] bindings generator.  When the module loads and detects 
FFI support it will replace the normal C bindings with pure Lua code [4] that 
uses the FFI interface.

with FFI disabled:
message size: 50 [B]
message count: 10,000,000
mean throughput: 1,453,423 [msg/s]
mean throughput: 581.369 [Mb/s]

with FFI enabled:
message size: 50 [B]
message count: 10,000,000
mean throughput: 2,969,533 [msg/s]
mean throughput: 1187.814 [Mb/s]

about 2 times the message throughput using FFI support.

1. http://zero.mq/
2. https://github.com/Neopallium/lua-zmq
3. https://github.com/Neopallium/LuaNativeObjects
4. https://github.com/Neopallium/lua-zmq/blob/master/src/zmq_ffi.nobj.lua

-- 
Robert G. Jakabosky