Skip to content

Introduce QuadList and use pooled quads#188

Merged
ChrisPulman merged 1 commit intomainfrom
ExtendFunctionality
Feb 1, 2026
Merged

Introduce QuadList and use pooled quads#188
ChrisPulman merged 1 commit intomainfrom
ExtendFunctionality

Conversation

@ChrisPulman
Copy link
Owner

Add a new pooled QuadList (NET8+), and update QuaternaryList to use it instead of List.

  • Added src/ReactiveList/Quaternary/QuadList.cs: a high-performance, ArrayPool-backed list with Add/Remove/AddRange/AsSpan/Enumerator and Dispose semantics.
  • Replaced List shards with QuadList in QuaternaryList and adapted usages (AsSpan(), AddRange calls, CopyTo, enumeration) to reduce allocations and improve bulk operations.
  • Fixed shard index calculation to use bitmasking: ((hash & 0x7FFFFFFF) & (ShardCount - 1)).
  • Added an _hasIndices fast-path to avoid unnecessary index notifications when no secondary indices exist.
  • Removed CollectionsMarshal usage and added CP.Reactive.Quaternary import.
  • Updated README.md benchmarks and memory comparison to reflect QuaternaryList/QuadList performance and memory improvements.

These changes aim to reduce allocations and improve throughput for large/bulk operations while preserving existing API behavior.

Add a new pooled QuadList<T> (NET8+), and update QuaternaryList to use it instead of List<T>.

- Added src/ReactiveList/Quaternary/QuadList.cs: a high-performance, ArrayPool-backed list with Add/Remove/AddRange/AsSpan/Enumerator and Dispose semantics.
- Replaced List<T> shards with QuadList<T> in QuaternaryList and adapted usages (AsSpan(), AddRange calls, CopyTo, enumeration) to reduce allocations and improve bulk operations.
- Fixed shard index calculation to use bitmasking: ((hash & 0x7FFFFFFF) & (ShardCount - 1)).
- Added an _hasIndices fast-path to avoid unnecessary index notifications when no secondary indices exist.
- Removed CollectionsMarshal usage and added CP.Reactive.Quaternary import.
- Updated README.md benchmarks and memory comparison to reflect QuaternaryList/QuadList performance and memory improvements.

These changes aim to reduce allocations and improve throughput for large/bulk operations while preserving existing API behavior.
@ChrisPulman ChrisPulman merged commit 0ea0cdc into main Feb 1, 2026
1 check passed
@ChrisPulman ChrisPulman deleted the ExtendFunctionality branch February 1, 2026 04:03
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