Comments (3)
@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
from cppwebsockets.
@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
from cppwebsockets.
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.
from cppwebsockets.
Related Issues (13)
- Just tested echoserver example with the latest libwebsockets.
- Using this project in a commercial project HOT 1
- Proposed solution to "double free or corruption (out)"
- CMake build/install CMakeLists.txt HOT 4
- Messages that are 3-4 k can be fragmented which isn't handled correctly in the callback and wait() hangs until connection
- libwebsockets doesn't exist anymore...
- lws_get_internal_extensions() not found !!
- echoserver Segfault with libwebsockets v1.7.2 HOT 4
- issues with the lib on embedded systems
- double free or corruption (out): 0x01114358 ***
- Yet another "double free or corruption (out)" HOT 4
- memory leak when sending large strings
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cppwebsockets.