eatonphil parent
> For the C “FFI” he used standard dynamic linking, not dlopen(). This distinction is important, since it really makes a difference in the benchmark. There’s a potential argument about whether or not this is a fair comparison to an actual FFI, but, regardless, it’s still interesting to measure
With clang, just compiling with -fno-plt gives me:
jit: 1.003483 ns/call
plt: 1.254158 ns/call
ind: 1.254616 ns/call
GCC does not seem to support it though, even if it accepts the flag and gives me: jit: 1.003483 ns/call
plt: 1.502089 ns/call
ind: 1.254616 ns/call
(tried everything I could think of that would have a chance to make the PLT disappear: cc -fno-plt -Bsymbolic -fno-semantic-interposition -flto -std=c99 -Wall -Wextra -O3 -g3 -Wl,-z,relro,-z,now -o benchmark benchmark.c ./empty.so -ldl
without any change on GCC)