Skip to content

Commit f811609

Browse files
CopilotPhenX
andcommitted
Add UseIncludeGraph property to benchmark project
Co-authored-by: PhenX <42170+PhenX@users.noreply.github.com>
1 parent 8e4dfe6 commit f811609

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

tests/PhenX.EntityFrameworkCore.BulkInsert.Benchmark/LibComparator.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ public abstract partial class LibComparator
1919
[Params(500_000/*, 1_000_000/*, 10_000_000*/)]
2020
public int N;
2121

22+
/// <summary>
23+
/// Set to true to benchmark with IncludeGraph option enabled.
24+
/// Default is false, which runs the benchmark exactly as before.
25+
/// </summary>
26+
public bool UseIncludeGraph { get; set; } = false;
27+
2228
private IList<TestEntity> data = [];
2329
protected TestDbContext DbContext { get; set; } = null!;
2430

@@ -58,7 +64,10 @@ protected virtual string GetConnectionString()
5864
[Benchmark(Baseline = true)]
5965
public async Task PhenX_EntityFrameworkCore_BulkInsert()
6066
{
61-
await DbContext.ExecuteBulkInsertAsync(data);
67+
await DbContext.ExecuteBulkInsertAsync(data, options =>
68+
{
69+
options.IncludeGraph = UseIncludeGraph;
70+
});
6271
}
6372
//
6473
// [Benchmark]

0 commit comments

Comments
 (0)