Coder Social home page Coder Social logo

Comments (3)

LoveChina-3000 avatar LoveChina-3000 commented on July 22, 2024

请教大佬第二个问题:大佬能再封装下libuv的pipe吗?用惯了大佬封装得libuv

from uv-cpp.

wlgq2 avatar wlgq2 commented on July 22, 2024

经常看到网络库宣传自己支持百万并发,其实大家都是epoll,iopc封的,理论上不是封的太挫,性能上不至于差非常多。这个库本身是对libuv封的,最初的设定就是不损耗太多额外的性能,libuv本身性能怎么样,它就是怎么样,所以这个库尽可能减少memcopy或者内存重新分配(比如读每个连接的数据,那个缓存是复用的,只有不够了才重新申请)。能跑多少,和你机器本身性能有关。

客户端这个例子你可以试试每个线程开个LOOP,每个LOOP分配若干客户端,还有关闭客户端的包处理缓存(会占内存,读包性能降低)。你可以试试和其他网络库对比。

from uv-cpp.

wlgq2 avatar wlgq2 commented on July 22, 2024

不要一个loop跑100w客户端,因为是单线程,开若干线程(比如你16核就16个线程),每个线程一个独立的loop对象,每个loop跑几万个客户端,你可以测试下看看性能。

from uv-cpp.

Related Issues (20)

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.