-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve generated assembly for pflang filters #27
Labels
Comments
With the new backend from #95, the code looks like:
and there are three traces:
|
The assembly's still kinda trash to be honest. Oh well though, the performance is certainly fine though. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The generated assembly is not ideal. For example, for a loop reading packets from a pcap-format savefile and matching them against "tcp port 5555", we have the function:
Here is the IR trace of the loop:
Anything having type "num" in the loop is suboptimal -- all of the types can be proven to be integers. All the mucking about with tables and ffis and checks and such are also unnecessary. As such we see that the body of the loop has lots of memory accesses and floating point comparisons:
Sub-optimal. To fix this, we can hack on LuaJIT, or look to emit assembly ourselves. I would try the former before the latter, as it's not far off from what needs to happen.
The text was updated successfully, but these errors were encountered: