GithubHelp home page GithubHelp logo

Comments (3)

bboubaker91 avatar bboubaker91 commented on May 23, 2024 2

@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.

vinniefalco avatar vinniefalco commented on May 23, 2024 1

@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.

bboubaker91 avatar bboubaker91 commented on May 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.