Git Product home page Git Product logo

Comments (3)

lemunozm avatar lemunozm commented on August 9, 2024

Hi @18o,

As you have seen, each node uses one thread to read from the network for all the connections that the node has (you can use other threads to write while you are reading). If you need to get more parallel performance you could split your connections into several nodes, but reading from one connection only can be done from one thread.

tokio gets mixing thread and network events in a transparent way using an async/await api. Keep in mind that using 8 cores to read from one connection in tokio will not be faster than using 1 core to read from one connection. What tokio's offers is an automatic load balance across multiple connections in multiple threads. In scenarios with more connections than threads, you will take better advantage of your processor.

from message-io.

18o avatar 18o commented on August 9, 2024

thanks for your response, i'll try use message-io in my project instead of tokio as it's really tiny and simple

from message-io.

lemunozm avatar lemunozm commented on August 9, 2024

I'm glad to hear that! 😃

The intention of message-io is to leave things as simple as possible (without losing performance as far as possible). I also like so much tokio, and use it in other projects, but the programming complexity is higher than message-io. It all depends on the target of your application.

from message-io.

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.