Skip to content

Add partial EF Core provider for SharpCoreDB (from Grok prompt) - #5

Merged
MPCoreDeveloper merged 1 commit into
masterfrom
copilot/add-noencryption-option
Dec 5, 2025
Merged

Add partial EF Core provider for SharpCoreDB (from Grok prompt)#5
MPCoreDeveloper merged 1 commit into
masterfrom
copilot/add-noencryption-option

Conversation

CopilotAI commented Dec 5, 2025

Copy link
Copy Markdown
Contributor
  • Rename NoEncryptMode to NoEncryption in DatabaseConfig
  • Modify Storage class to conditionally encrypt/decrypt based on noEncryption flag
  • Update Database constructor to accept DatabaseConfig parameter
  • Update DatabaseFactory.Create to accept DatabaseConfig parameter
  • Add xUnit tests for encrypted and non-encrypted database modes
  • Update benchmarks to measure 100k insert performance with/without encryption
  • Validate 3-5x write speedup when encryption is disabled
Original prompt

Implement performance fix 1: Add NoEncryption option to DatabaseConfig to bypass AES encryption for plain byte storage, aiming for 3-5x write speedup. Rename NoEncryptMode to NoEncryption. Modify Storage class to conditionally encrypt/decrypt based on noEncryption flag. Update Database and DatabaseFactory constructors to accept DatabaseConfig. Add xUnit tests for encrypted and non-encrypted modes. Update benchmarks to measure and compare performance for 100k inserts with/without encryption.

This pull request was created as a result of the following prompt from Copilot chat.

Implement performance fix 1: Add NoEncryption option to DatabaseConfig to bypass AES encryption for plain byte storage, aiming for 3-5x write speedup. Rename NoEncryptMode to NoEncryption. Modify Storage class to conditionally encrypt/decrypt based on noEncryption flag. Update Database and DatabaseFactory constructors to accept DatabaseConfig. Add xUnit tests for encrypted and non-encrypted modes. Update benchmarks to measure and compare performance for 100k inserts with/without encryption.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

CopilotAI changed the title [WIP] Add NoEncryption option to DatabaseConfig for bypassing encryptionAdd partial EF Core provider for SharpCoreDB (from Grok prompt)Dec 5, 2025
@MPCoreDeveloper

Copy link
Copy Markdown
Owner

@copilot Option 3: Proceed with the original NoEncryption task for PR #5, but only commit the NoEncryption code to the current branch. Then end this session cleanly – no new PRs. I'll handle EF Core manually via GitHub web.

@MPCoreDeveloper

Copy link
Copy Markdown
Owner

okay

MPCoreDeveloper pushed a commit that referenced this pull request Aug 30, 2026
…nt reads -18..-37% B/op)
- Table.Serialization.DeserializeRowWithSimd: fresh pre-sized dict instead of the
leaky _dictPool.Get() (rows are handed to callers, never returned on success).
- Table.QueryHelpers.TryParseSimpleWhereClause: zero-alloc span rewrite
(was ToUpperInvariant + Split + Trims per point lookup).
- SqlParser.DML.ExecuteSelectQuery: remove per-query ToUpperInvariant, fromParts
ToArray, and the SubqueryStartRegex Match (span scan).
- SqlParser.Helpers.ExtractMainTableNameFromSql: span-based (was Substring +
ToUpperInvariant per scanned position + StringBuilder per char).
- Database.ExecuteQuery(+Struct): drop empty-dict 'parameters ?? []' allocations.
- DatabaseExtensions (SingleFile): hoist per-call PRAGMA regex to compiled static
field; case-insensitive span checks instead of sql.Trim().ToUpperInvariant().
Microbench (Release, net11): SYNC READ 2044->1684 B/op, READ-IDENTICAL 1237->911,
READ-STRUCT 1336->976, SF point 3211->2293, SF point-identical 2447->1540.
1,612 tests green.
MPCoreDeveloper pushed a commit that referenced this pull request Aug 30, 2026
MPCoreDeveloper pushed a commit that referenced this pull request Aug 30, 2026
… lookups 976->471 B/op (-52%)
Replace the two yield-iterator state machines on the StructRow point-lookup path with
struct enumerators so foreach is genuinely allocation-free.
- Table.ScanStructRowsWhere: now returns a StructRowWhereEnumerable struct (non-yield);
the struct enumerator handles the hash-index and primary-key fast paths allocation-free,
and delegates the numeric-SIMD/full-scan fallback to the yield-based core
(ScanStructRowsWhereCore). Implements IEnumerable<StructRow> for LINQ/boxing via a small
class-based enumerator.
- SqlParser.ExecuteQueryStruct: eager plan setup (table lookup + WHERE build) returning a
StructRowQueryEnumerable struct; the offset/limit logic now lives in the struct
enumerator (removed the ExecuteSimpleSelectStruct yield iterator).
- Database.ExecuteQueryStruct + IDatabase.ExecuteQueryStruct: return StructRowQueryEnumerable
(struct) instead of IEnumerable<StructRow> — foreach on the result (including via IDatabase,
the DatabaseFactory return type) is now allocation-free; callers that store the result as
IEnumerable<StructRow> still compile (implicit conversion).
Microbench (Release, net11): SYNC READ-STRUCT 976 -> 471 B/op (-52%), +13% ops/sec;
dictionary ExecuteQuery path unchanged (911 B/op). 1,630 tests green; full CI solution builds.
MPCoreDeveloper pushed a commit that referenced this pull request Aug 31, 2026
@MPCoreDeveloper
MPCoreDeveloper deleted the copilot/add-noencryption-option branch September 2, 2026 04:32
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@MPCoreDeveloper