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

How does this compare to Beast? #5

Open
vinniefalco opened this issue May 28, 2016 · 3 comments
Open

How does this compare to Beast? #5

vinniefalco opened this issue May 28, 2016 · 3 comments

Comments

@vinniefalco
Copy link

How does this compare to Beast, which offers WebSocket and HTTP implementations?
http://vinniefalco.github.io/

@bboubaker91
Copy link

If you are doing an embedded project and you cross- compile for example using Beast. you will see the difference. This one is good in term of performance. Libwebsocket (the base lib used here before wrapping https://libwebsockets.org/ ) is widely used in embedded linux .... at the end you get almost 0% of CPU usage and much better memory performance (very small memory occupation). If there are for example many clients connected , request/response handling will perform much better.

@vinniefalco
Copy link
Author

vinniefalco commented May 28, 2016

@boubakerbassem That sounds good in theory, but a comparison of autobahn performance test results of libwebsockets versus Beast tells quite a different story (lower is better):

Test Beast libwebsockets
9.1.6 275 ms 2202 ms
9.2.6 291 ms 3360 ms
9.3.1 1501 ms 13949 ms
9.4.1 1485 ms 11950 ms
9.7.1 122 ms 802 ms
9.8.1 113 ms 1150 ms

Sources:
http://vinniefalco.github.io/autobahn/index.html
https://libwebsockets.org/reports/clients/index.html

@bboubaker91
Copy link

bboubaker91 commented May 28, 2016

@vinniefalco In theory I think the story is a bit different .

The question will be : are we comparing performance in an embedded linux or not?

Beast is depending on BOOST witch :

1- uses a lot of dynamic memory allocation (not good if you work under memory limitation).

2-By using boost, your instantiating some other classes and this will have some cost effects (a class will call another that will call another etc....).

3-Boost is not using reference for passing variables into functions. So, every time a function is called, the variable will be copied into a temporary one before entering the function ( a lot of wasted stack memory if you are passing some complex typed variable ). I should remind that copying input variables itself do have some cost too.

Most of good embedded c++ developer are avoiding projects with BOOST dependencies for these reasons. At least I do :D

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