Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing benchmarks #9

Merged
merged 1 commit into from Apr 9, 2021
Merged

Introducing benchmarks #9

merged 1 commit into from Apr 9, 2021

Conversation

huntc
Copy link
Contributor

@huntc huntc commented Apr 6, 2021

A separate sub-project is introduced to benchmarking for Stage and each of its executors w.r.t. to the things that actors are capable of i.e. sending messages to other actors; and creating new actors.

To achieve the benchmark logic, I've implemented the ask method on ActorRef. I'm not entirely happy with its implementation right now, as it exposes the Receiver type to the caller. There's more work to do there; perhaps as a separate PR though. I'm thinking that the ask method should be async instead, but it would also require another method on the Receive type to actually receive. More thinking required.

Prelim benchmarks show Crossbeam/Executors to be significantly faster:

send messages to other actors using Crossbeam and Executors with bounded channels                                                                             
                        time:   [3.5891 us 3.6211 us 3.6609 us]

send messages to other actors using Crossbeam and Executors with unbounded channels                                                                             
                        time:   [3.4969 us 3.5105 us 3.5262 us]

send messages to other actors using Tokio with bounded channels                                                                             
                        time:   [10.952 us 11.087 us 11.229 us]

send messages to other actors using Tokio with unbounded channels                                                                             
                        time:   [10.823 us 10.928 us 11.033 us]

create new actors using Crossbeam and Executors with unbounded channels                                                                             
                        time:   [1.1376 us 1.1579 us 1.1786 us]

create new actors using Tokio with unbounded channels                                                                             
                        time:   [2.3946 us 2.5501 us 2.8059 us]

In summary, Crossbeam/Executors tends to perform 2.5 to 3 times faster than Tokio so far, and unbounded channels slightly performing bounded ones across both.

A separate sub project is introduced to benchmark Stage for each of its executors w.r.t. to the things that actors are capable of i.e. sending messages to other actors; and creating new actors.
@huntc huntc requested a review from stevewillcock April 9, 2021 00:32
@huntc huntc marked this pull request as ready for review April 9, 2021 00:32
Copy link

@stevewillcock stevewillcock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, and interesting results!

@huntc huntc merged commit 84db18e into titanclass:master Apr 9, 2021
@huntc huntc deleted the benches branch April 9, 2021 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants