开发者

What are the trade offs between ffi and mri c extensions in ruby?

开发者 https://www.devze.com 2023-01-15 13:50 出处:网络
What are the tr开发者_JS百科ade offs between ffi and mri c extensions in ruby?One obvious tradeoff is that MRI C extensions only work on MRI, whereas FFI extensions work on MRI, YARV, Rubinius and JRu

What are the tr开发者_JS百科ade offs between ffi and mri c extensions in ruby?


One obvious tradeoff is that MRI C extensions only work on MRI, whereas FFI extensions work on MRI, YARV, Rubinius and JRuby at the moment, and will in the future probably also work on IronRuby, MagLev, MacRuby, SmallRuby, tinyrb and RubyGoLightly.


ffi is a tidge slower for method call invocation. Also ffi can't use any "native C" code unless you combine it with compilation, for example with ffi-inliner.

ffi is much more cross-VM friendly.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号