4 ms·
I'd be interested in seeing Ruby-FFI, CPython, CFFI (Common Lisp) and C#'s DllImport.
by vortico 8y ago
I'd be interested in seeing Ruby-FFI, CPython, CFFI (Common Lisp) and C#'s DllImport.
- jlarocco 8y agoI was curious about Common Lisp's CFFI also, so I tried it out. [1] On my machine, the C version prints between 6855 and 6910. Using SBCL (cffi-bench:run 2000000000) prints between 9185 and 9205. Clisp is significantly slower, and (cffi-bench:run 200000000) is already at 55500, compared to ~100 in SBCL. CCL crashes with a segmentation fault, and I'm still debugging. Tomorrow I'll see about creating a build script and opening a pull request to the main repo. [1] https://github.com/jl2/ffi-overhead/tree/master/common-lisp/cffi-bench/cffi-bench.lisp https://github.com/jl2/ffi-overhead/tree/master/common-lisp/... EDIT: I recompiled the .so and C program with -O3, and it now prints between 4740-4780. SBCL using the -O3 library prints 7935 and 8935.
- nabla9 8y agoIf we use the C performance ratio between the machines to adjust machine to machine comparisons. SBCL would be around 1600 in the original benchmark, between D and Java.
- scruple 8y agoI built out a ruby-ffi test immediately upon seeing this. I want to put a little more effort in to it (I need to run some errands and spent all of 5 minutes on this), but... 2 samples/runs, 500M calls: 51050, 50853. No surprises there, really. edit/ Ran this on my desktop (gaming rig) i7-4790k, 16GB RAM, gcc 7.3.1 20180406, Arch on Windows Subsystem for Linux. I have a machine closer in specs to the original authors that I'll test it against later today (hopefully).
- calvin_ 8y ago[Here's a C# example](https://github.com/dyu/ffi-overhead/pull/10 https://github.com/dyu/ffi-overhead/pull/10).