Closed tuxology closed 8 years ago
Thanks for the note. My thought was to keep the interpreter simple and rely on the JIT for performance.
Here's an interesting paper I found recently that talks about dispatch performance: https://hal.inria.fr/hal-01100647/document.
ps. We've moved the official repo to http://github.com/iovisor/ubpf. I just turned on GitHub issues there.
OK, this is interesting :) Indeed, JIT is the way to go!
This is based on just a cursory look to the code so please feel free to reject this if you feel so.
The current interpreter seems to be using a
switch-case
dispatch mechanism. You can improve the performance a little by using better mechanisms like direct or in-line threaded dispatch as described here. It however needs compiler support for labels as values usage so you can probably use theswitch-case
as a fallback as well.The kernel's eBPF interpreter is using that already and I took it for my experiments :)