Skip to content
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

Read-only tables performance #4

Open
lukego opened this issue Jan 5, 2017 · 2 comments
Open

Read-only tables performance #4

lukego opened this issue Jan 5, 2017 · 2 comments

Comments

@lukego
Copy link

lukego commented Jan 5, 2017

I am very interested in the read-only tables feature. I have seen promising results in a microbenchmark (LuaJIT#248 (comment)) and now I am testing with a real application (Snabb).

Initial scores are low on my simplest Snabb benchmark. Baseline score is 27, merging the readonlytables branch (commit 68515a2) this drops to 7, and adding a couple of calls to table.setreadonly() that I expected to be beneficial dropped the score to 0.1. So the opening position is a 270x slowdown and I am keen to improve on this :-)

Just quick questions if I may:

  • Is readonlytables the right branch? I also see readonly_tables.
  • Any loose ends in the implementation that I should be aware of?
  • Any immediate idea on what could cause a performance drop even when not calling table.setreadonly()?

Cheers!

@lukego
Copy link
Author

lukego commented Jan 5, 2017

Step to reproduce JFYI:

$ git clone -b jit-readonly https://github.com/lukego/snabb
$ make -C snabb -j
$ sudo snabb/src/snabb snsh -jv -p snabbmark basic1 10e6
Processed 10.0 million packets in 68.06 seconds (rate: 0.1 Mpps).

@fsfod
Copy link
Owner

fsfod commented Jan 5, 2017

Is readonlytables the right branch? I also see readonly_tables.

I thought I hadn't pushed it from a separate repo before.

Any loose ends in the implementation that I should be aware of?

It was more proof of concept I only tested simple examples work.

Any immediate idea on what could cause a performance drop even when not calling table.setreadonly()?

The most likely answer is my changes might be causing a bad guard to be emitted that always fails or I might be causing traces to be always aborted for some reason. You can try just the first commit on its own since it only touch the interpreter which in theory should 0 to almost no slowdown. The collocated table size field for marking a table readonly could be getting some weird collision i didn't correctly check for

fsfod pushed a commit that referenced this issue Nov 22, 2017
Fix C VM events breaking disabled JIT builds
fsfod pushed a commit that referenced this issue May 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants