Giter Club home page Giter Club logo

Comments (4)

hexsel avatar hexsel commented on May 24, 2024

Ah nvm, the InnerActorSystem uses channels, which kind of fulfill the same role.

from robots.

gamazeps avatar gamazeps commented on May 24, 2024

So can i do anything ? (real question, I am more than open to any amelioration idea :) )

PS: thanks for taking the time for reading the code despite the awful documentation :/

from robots.

hexsel avatar hexsel commented on May 24, 2024

Nah, the code is using channels, which for multi-producer, single-consumer scenarios like actors, seems to be the best alternative (according to @aturon's Crossbeam paper at https://aturon.github.io/blog/2015/08/27/epoch/, seems to be the best-performing alternative).

There is excessive locking, as you can see a message could be taking as little as 50ns or so (compared to 4,000,000 or so that it's currently taking), but I don't know how to improve the design substantially and keep your goal to have a similar API to Akka's (I'm a pretty big fan of akka even though it has it's rough edges if your use-case is not out of the box).

from robots.

gamazeps avatar gamazeps commented on May 24, 2024

@hexsel, the 4.000.000ns on the benches are for 1_000 messages, that is indeed very slow but not as slow as what you thought :)

That's about 200.000 msg/seconds which is pretty low, but it'as also due to the fact that the system in this way does not take advantage of the parallelism since there is a single consumer actor, and that it cannot be run on multiple thread at the same time (for obvious concurrency reasons), an i3 would be as performant as an i7 or a xeon in this case.

I tried to shave some ns, but the only thing I could think about was to code my own primitives for my use case and use a fair amount of unsafe (there currently is no unsafe code at all, even though that should change pretty soon, but you get the idea). Indeed callgrind showed me no obvious bottleneck, it's more about having a lot of locks and reference counting.

The bench overall are on the same order as Erlang, so I was satisfied enough with that, but if this becomes critical I'm willing to start shaving nanoseconds.

Thanks for the paper it's a great read :)

from robots.

Related Issues (8)

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.