File tree Expand file tree Collapse file tree
tests/PhenX.EntityFrameworkCore.BulkInsert.Benchmark Expand file tree Collapse file tree Original file line number Diff line number Diff 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]
You can’t perform that action at this time.
0 commit comments