Summary
All EF Core providers use SingularModificationCommandBatch, which executes one command at a time. This means each INSERT/UPDATE/DELETE in a SaveChanges() call results in a separate round-trip to the file system.
Current Implementation
Each provider's IModificationCommandBatchFactory creates a SingularModificationCommandBatch:
public ModificationCommandBatch Create() => new SingularModificationCommandBatch(...);
What's Needed
A batched implementation that groups multiple modification commands into a single file write operation. For file-based providers, this is particularly impactful because:
- Each write currently re-serializes the entire file
- Batching N inserts into a single write avoids N-1 redundant file rewrites
- The transaction system already queues writes — the batch factory should leverage this
Impact
SaveChanges() with 100 new entities results in 100 separate file write operations instead of 1. This is a significant performance issue for any non-trivial workload.
Standard Reference
Summary
All EF Core providers use
SingularModificationCommandBatch, which executes one command at a time. This means each INSERT/UPDATE/DELETE in aSaveChanges()call results in a separate round-trip to the file system.Current Implementation
Each provider's
IModificationCommandBatchFactorycreates aSingularModificationCommandBatch:What's Needed
A batched implementation that groups multiple modification commands into a single file write operation. For file-based providers, this is particularly impactful because:
Impact
SaveChanges()with 100 new entities results in 100 separate file write operations instead of 1. This is a significant performance issue for any non-trivial workload.Standard Reference