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

Create benchmarks for System.Threading.Tasks.Dataflow #951

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update according to first review
  • Loading branch information
manandre committed Nov 6, 2019
commit f6e97aaf433e9332b828fb08f1dc58655b4b48e5
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,6 @@ public override ActionBlock<int> CreateBlock() =>
);
}

public class UnorderedParallelActionBlockPerfTests : TargetPerfTests<ITargetBlock<int>>
{
public override ITargetBlock<int> CreateBlock() =>
new ActionBlock<int>(
i => { },
new ExecutionDataflowBlockOptions
{
MaxDegreeOfParallelism = Environment.ProcessorCount,
EnsureOrdered = false
}
);
}

public class SingleProducerConstrainedActionBlockPerfTests : TargetPerfTests<ITargetBlock<int>>
{
public override ITargetBlock<int> CreateBlock() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ namespace System.Threading.Tasks.Dataflow.Tests
[BenchmarkCategory(Categories.CoreFX)]
public class BroadcastBlockPerfTests : ReceivablePropagatorPerfTests<BroadcastBlock<int>, int>
{
public override BroadcastBlock<int> CreateBlock() =>
new BroadcastBlock<int>(
i => i,
new ExecutionDataflowBlockOptions
{
MaxDegreeOfParallelism = Environment.ProcessorCount
});
public override BroadcastBlock<int> CreateBlock() => new BroadcastBlock<int>(i => i);

[Benchmark(OperationsPerInvoke = MessagesCount)]
public Task PostMultiReceiveParallel() => MultiParallel(() => Post());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public abstract class PerfTests<T> where T : IDataflowBlock

public abstract T CreateBlock();

[GlobalSetup]
[IterationSetup]
public void BlockSetup()
{
block = CreateBlock();
Expand Down