Search
Saturday, 14th of May 2022, 10:17:45 UTC
12:27:55
Krystof
(those should now both be fixed in HEAD)
16:14:53
flip214
I just did the FFI-Overhead stuff (from https://github.com/dyu/ffi-overhead)... SBCL takes 3x as long as luajit
16:16:20
Shinmera
how does luajit have a lower overhead than C itself. That seems bizarre?
16:16:41
flip214
https://github.com/phmarek/ffi-overhead for anyone interested
16:17:05
flip214
perhaps it disassembles and recompiles, noticing the plain simplicity?
16:17:30
flip214
and optimizing to a INC RAX or so
16:17:45
Shinmera
I very much doubt that
16:18:29
flip214
me too ;) but it wouldn't be completely impossible
16:19:10
flip214
just do a callout to ghidra to get a clang IR back (just wishing)
16:42:24
|3b|
is that 3x luajit about 2x c?
16:48:59
|3b|
flip214: out of curiosity, is it any faster if you (check-type count (unsigned-byte 31))?
16:57:33
|3b|
on my machine, loop overhead is about 1 sec for 500M if it is doing generic math for the loop counter
16:58:02
|3b|
ACTION is too lazy to actually build the shared lib though, so not sure how that compares to whole thing
18:50:27
flip214
|3b|: my branch has a simple Makefile for hello.c and the so
18:51:24
flip214
|3b|: thanks, that helps quite a lot
18:51:48
|3b|
ACTION is on windows, so "the so" crosses my very low threshold of "too much work" :)
18:52:23
|3b|
(and even if it did handle windows transparently, i should be working on other things anyway)
18:53:25
flip214
|3b|: now it's faster than the C version, thanks - will make a PR
18:58:11
|3b|
someone should do something like that for non-trivial FFI
18:58:50
|3b|
ACTION is curious how many others fall over on things like struct-by-value
18:58:52
flip214
yeah, I read that on HN too
18:59:11
flip214
|3b|: OTOH, the debian shootout has a few fruits left for us...
18:59:34
flip214
especially when SB-SIMD goes live upstream
18:59:49
flip214
Inline: what's what? "HN" is "Hacker News", news.ycombinator.com
19:03:24
karlosz
Shinmera: I think luaJIT ffi is expected to be faster than C -> C calls
19:03:36
karlosz
C -> C calls use some indirections for PLT and GOT
19:03:47
karlosz
luaJIT can optimize those out because of the JIT nature
19:04:23
karlosz
this describes the result https://nullprogram.com/blog/2018/05/27/
19:04:32
Shinmera
Ah, that's what I thought it might be.
19:09:25
|3b|
flip214: i wasn't so much thinking of the marshalling stuff they mention on hn as what we see in CFFI where it just can't do that in the portability layer, so drops to libffi for "complicated" calls
19:09:51
|3b|
and wondered if other FFIs have similar slow paths
19:12:26
|3b|
which would be interesting to know since then i'd know whether to complain to sbcl "everyone else can do this well" or complain to C libs "hardly anybody can do this well"
19:44:02
|3b|
hmm, *disassemble-annotate* T breaks disassembly of code using #+#.(foo)
Saturday, 14th of May 2022, 22:17:45 UTC