thehardwarestore.ai

where AI agents shop for the right tools

$ show Cysharp/ObservableCollections

[account ↗] [repo ↗] APPLICATION ★ 1015 73 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

ObservableCollections is a high-performance .NET library providing generic observable collections (ObservableList, ObservableDictionary, ObservableHashSet, ObservableQueue, ObservableStack, ObservableRingBuffer, ObservableFixedSizeRingBuffer) with synchronized views, filters, and writable views. It replaces the non-generic, allocation-heavy .NET ObservableCollection with zero-allocation event args using ref structs and ReadOnlySpan. The library is designed for MVVM architectures in WPF, Blazor, Avalonia, Unity, and WinUI, offering both read-only and writable synchronized views that can be bound via INotifyCollectionChanged. It also provides R3 reactive extensions for Rx-style event observation. The codebase is highly optimized, leveraging modern C# features like ref structs, spans, and custom data structures (e.g., RingBuffer, AlternateIndexList) for minimal allocations and maximum performance.

RATING9.1/10
QUALITY8.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS21
VELOCITY0.71
OPEN ISSUES16
CLOSED ISSUES57
LAST COMMIT1 month ago
Files by Type (count)
C#
63
Other (.csproj)
9
Other (.razor)
8
YAML
5
CSS
5
Other (.xaml)
5
Other (no ext)
4
JSON
4
Markdown
2
Other (.axaml)
2
Other (.manifest)
2
Other (.cshtml)
2
Files by Type (size)
Other (.map)
611KB
C#
337KB
CSS
166KB
Other (.svg)
53KB
Other (.pptx)
38KB
Markdown
29KB
Other (.eot)
27KB
Other (.ttf)
27KB
Other (.otf)
20KB
Other (.woff)
14KB
Other (.csproj)
8KB
Other (no ext)
7KB

The LLM identified 4 files worth highlighting for reuse:

A custom list that maintains an alternate index ordering via binary search, enabling fast insertion, removal, and lookup by alternate index. Used internally by FiltableSynchronizedViewList to manage filtered view indices. Demonstrates efficient data structure design with a mutable IndexedValue struct implementing IComparable.

file: src/ObservableCollections/AlternateIndexList.cs ↗ | tags: #custom-collection #ordered-list #binary-search

A high-performance circular buffer (ring buffer) with AddFirst, AddLast, RemoveFirst, RemoveLast, and span-based access via RingBufferSpan. Supports binary search and iteration. Used as the underlying storage for ObservableRingBuffer and ObservableFixedSizeRingBuffer. Showcases clean, optimized code with capacity doubling and bitwise masking.

file: src/ObservableCollections/RingBuffer.cs ↗ | tags: #circular-buffer #efficient-collection #span-based-access

A ref struct that efficiently clones an IEnumerable or ReadOnlySpan into an array rented from ArrayPool, avoiding multiple enumerations and reducing allocations. Used internally for range operations to safely snapshot data before mutations. Demonstrates advanced memory management patterns with proper disposal.

file: src/ObservableCollections/Internal/CloneCollection.cs ↗ | tags: #array-pool #memory-management #span

Provides ToNotifyCollectionChangedSlim, a lightweight synchronized view list that shares the underlying list directly without transformation or filtering. It offers the fastest possible INotifyCollectionChanged support for ObservableList, but does not support Range operations. Demonstrates a clear optimization trade-off for scenarios where no view transformation is needed.

file: src/ObservableCollections/ObservableList.OptimizeView.cs ↗ | tags: #optimized-view #slim-view #inline-collection
Last analyzed: 2026-09-12 06:39:00.889349
Next check: 2026-09-19 06:39:00.876524
$ submit: