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

Backport v1.4.44 performance fixes to v1.5 #6162

Merged
merged 10 commits into from
Oct 8, 2022

Conversation

Aaronontheweb
Copy link
Member

No description provided.

* WIP queue benchmarks

* completed MailboxThroughputBenchmarks

* disable `CallingThreadDispatcher`
* added parameterized Dispatcher benchmarks

* fixed naming - also, pull all config from Akka defaults
…readPool` (akkadotnet#6143)

Instead of having the `DedicatedThreadPool` operate on `Action` delegates, we now just take the `IRunnable` directly. Avoids a delegate allocation per-invocation.
purpose of this benchmark is not to measure processing time - it's meant to measure allocation pressure created by Akka.NET infrastructure:

* `Envelope`s
* `Mailbox` and `MessageDispatcher` overhead
* `ActorCell` and `ActorBase` invocation overhead

Ideally the memory pressure, given a `const string` as messaging input, should be close to zero - but between mailbox queue segment allocations, delegate + closure allocations, and probably some boxing we know that's not the case. Purpose of this benchmark is to measure that impact across threads.
* convert `Envelope` back into a reference type

* approved API changes

* changed to `readonly struct`

* fixed API approvals
* close akkadotnet#2560 - added performance benchmarks for FSM

* Improved FSM memory consumption

* Made `Event` a `readonly struct`
* Eliminated unnecessary `List<object>` allocations
* Cleaned up XML-DOC comments

* don't return new `State<TState, TData>` during `Stay()`

* API approvals

* fixed `State<TS.,TD>` errors
)

* make `DedicatedThreadPool.QueueUserWorkItem<T>` generic

Done to avoid boxing allocations

* make adding methods generic
@Aaronontheweb Aaronontheweb added this to the 1.5.0 milestone Oct 8, 2022

private void RequestWorker()
{
_pool.QueueUserWorkItem(new RequestWorkerTask(this));
Copy link
Member Author

Choose a reason for hiding this comment

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

Made RequestWorkerTask a class again @to11mtm

@Aaronontheweb Aaronontheweb merged commit 04a24be into akkadotnet:dev Oct 8, 2022
@Aaronontheweb Aaronontheweb deleted the backport-v1.4.44 branch October 8, 2022 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant