-
Notifications
You must be signed in to change notification settings - Fork 1k
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
eliminated allocations with StandardOutWriter #1881
Conversation
Ok, made some changes to BeforeAkka.Tests.Performance.Util.StandardOutWriterMemoryBenchmark+StressTestStandardOutWriterTesting to see if the design of the StandardOutWriter produces allocations System InfoNBench=NBench, Version=0.2.1.0, Culture=neutral, PublicKeyToken=null
OS=Microsoft Windows NT 6.2.9200.0
ProcessorCount=4
CLR=4.0.30319.42000,IsMono=False,MaxGcGeneration=2
WorkerThreads=32767, IOThreads=4 NBench SettingsRunMode=Throughput, TestMode=Measurement
NumberOfIterations=13, MaximumRunTime=00:00:01 DataTotals
Per-second Totals
Raw DataTotalBytesAllocated
TotalCollections [Gen0]
TotalCollections [Gen1]
TotalCollections [Gen2]
[PerformanceCounter] .NET CLR Memory:# of Pinned Objects:NBench.Runner
[PerformanceCounter] .NET CLR Memory:# Bytes in all Heaps:NBench.Runner
[PerformanceCounter] .NET CLR Memory:# GC Handles:NBench.Runner
[Counter] StandardOutWrites
|
AfterAkka.Tests.Performance.Util.StandardOutWriterMemoryBenchmark+StressTestStandardOutWriterTesting to see if the design of the StandardOutWriter produces allocations System InfoNBench=NBench, Version=0.2.1.0, Culture=neutral, PublicKeyToken=null
OS=Microsoft Windows NT 6.2.9200.0
ProcessorCount=4
CLR=4.0.30319.42000,IsMono=False,MaxGcGeneration=2
WorkerThreads=32767, IOThreads=4 NBench SettingsRunMode=Throughput, TestMode=Measurement
NumberOfIterations=13, MaximumRunTime=00:00:01 DataTotals
Per-second Totals
Raw DataTotalBytesAllocated
TotalCollections [Gen0]
TotalCollections [Gen1]
TotalCollections [Gen2]
[PerformanceCounter] .NET CLR Memory:# of Pinned Objects:NBench.Runner
[PerformanceCounter] .NET CLR Memory:# Bytes in all Heaps:NBench.Runner
[PerformanceCounter] .NET CLR Memory:# GC Handles:NBench.Runner
[Counter] StandardOutWrites
|
I wasn't able to collect any Writing to the However, we were also allocating a fairly large number of delegates while calling this, which is why the previous metric
Is now
|
eed7cc7
to
5e9db63
Compare
{ | ||
WriteToConsole(() => Console.Write(message), foregroundColor, backgroundColor); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caused an allocation; removed.
…riter eliminated allocations inside StandardOutWriter
5e9db63
to
7bda483
Compare
{ | ||
WriteToConsole(() => Console.WriteLine(message), foregroundColor, backgroundColor); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caused an allocation; removed.
Looks ok, Runs ok. |
Found some memory leaks in Helios which revolve around the use of delegates with context closures - realized it might explain some of the memory leak reports we've had around logging in Akka.NET. Found some code inside the
StandardOutWriter
that uses delegates similarly and profiled it.Added
NBench.PerformanceCounters
to get some more detailed metrics.