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

Is it possible to use lua-radix-router to get the best performance? #21

Closed
vm-001 opened this issue Jan 13, 2024 · 11 comments
Closed

Is it possible to use lua-radix-router to get the best performance? #21

vm-001 opened this issue Jan 13, 2024 · 11 comments

Comments

@vm-001
Copy link
Contributor

vm-001 commented Jan 13, 2024

Hi @huahua132 . The lua-radix-router is optimized for high performance. Compared to the current router(based on redis rax), the lua-radix-router is 70x faster in real-world use cases. It is possible to switch lua-radix-router? I think the APIs are basically the same, it should be easy to replace without introducing any breaking changes.

@huahua132
Copy link
Owner

I need to compare before deciding whether to replace

@vm-001
Copy link
Contributor Author

vm-001 commented Jan 14, 2024

I made a PR here #22. Let me know if you have concerns.

@huahua132
Copy link
Owner

Thank you for your recommendation, I need to think about it carefully

@vm-001
Copy link
Contributor Author

vm-001 commented Jan 15, 2024

Take your time. Do you have test cases for the current router based on rax. I don't see GitHub workflow in this repo. I would like to run the test

@huahua132
Copy link
Owner

The test cases for rax are available here https://github.com/hanxi/lua-rax.
Introduction to the workflow of this project. Sorry, the English version is not available yet. You can take a look at the Chinese version introduction

@huahua132
Copy link
Owner

image

@huahua132
Copy link
Owner

Already replaced, the test results are here https://huahua132.github.io/2024/01/14/skynet_fly/benchmark_rax/

@vm-001
Copy link
Contributor Author

vm-001 commented Jan 17, 2024

That's nice. Can you share your benchmark scripts? I'd like to double check them. Perhaps you can upload the benchmark in a separate repo so everyone can reproduce it.

@huahua132
Copy link
Owner

huahua132 commented Jan 18, 2024

script is here https://github.com/huahua132/skynet_fly/blob/master/test/module/radix_router_test_m.lua
You can run it like this
git clone https://github.com/huahua132/skynet_fly.git
make build
cd test
sh make.sh
sh sh script/restart.sh load_mods_radix_router.lua
vim logs/server.log

@vm-001
Copy link
Contributor Author

vm-001 commented Jan 18, 2024

I couldn't run the tests due to some dependencies issue. It looks like you added micro-benchmarks on this repo. Another way is moving it outside this repo so you keep this repo cleaner(and no unnecessary dependencies), and you can have the integration benchmark in this repo which tells the performance of the web framework. But it's up to you.

@huahua132
Copy link
Owner

Sorry, this suggestion cannot be adopted. The web is only one of the functions of the framework. The web also relies on many framework functions, so it is not easy to separate them independently.

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