Skip to content

Experimental Optimizations#4130

Merged
jeremydmiller merged 3 commits intomasterfrom
optimizations
Feb 15, 2026
Merged

Experimental Optimizations#4130
jeremydmiller merged 3 commits intomasterfrom
optimizations

Conversation

@jeremydmiller
Copy link
Member

No description provided.

jeremydmiller and others added 3 commits February 15, 2026 09:20
…aths

- ChangeTracker: add fast-path string comparison before expensive JToken
  parse and deep-compare; reuse serialized JSON on change detection
- QuickAppendEventsOperationBase: replace 7 separate Select().ToArray()
  LINQ chains with single-pass for loops; replace Reverse() with backward
  for loops
- UnitOfWork: return underlying list directly from AllOperations when one
  side is empty; replace OrderBy().ToList() with in-place List.Sort()
- UpdateBatch: replace O(n²) Skip().Take().ToArray() paging with direct
  indexed array filling
- DirtyCheckingDocumentSession: replace O(n*m) array Contains with
  HashSet using ReferenceEqualityComparer
- MemberFinder: replace O(n²) List.Insert(0) with Add() and
  Array.Reverse at the end
- ProjectionUpdateBatch: check listener counts before allocating
  Concat().ToArray(); iterate both lists separately
- NamedParameterHelper: cache PropertyInfo[] per parameter type in
  ConcurrentDictionary; pre-size lookup dictionary
- DocumentStorage: cache MetadataColumns() result since schema is
  immutable after initialization

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- ChangeTracker: remove `_json = newJson` from DetectChanges() which
  reset the baseline after the first read, causing subsequent calls
  (e.g. PendingChanges.Updates() after UpdatesFor<T>()) to miss changes
- MemberFinder: revert Add() + Array.Reverse() back to Insert(0) since
  many consumers access Members directly without going through
  Determine(), causing reversed property paths in patching (33 failures)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to 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.

1 participant