DSExpose Extended
An Unreal Engine plugin module that exposes fast sort and search algorithms to C++ and Blueprints for UObject pointers, geometry structs, gameplay types, and generic USTRUCTs
Overview
DSExposeExtended is the second module of the DSExpose Unreal Engine plugin, extending the base module’s primitive sort and search capabilities to cover the full richness of UE’s type system. It exposes fast, Blueprint-callable sort and search algorithms for UObject pointer arrays, geometry structs (FVector, FRotator, FTransform, FLinearColor), gameplay types (FGameplayTag, soft references), identity types (FName, FGuid, FDateTime), and raw USTRUCT byte arrays. Designed as a drop-in addition to any UE 4.26–5.7 project, it delivers 3–8× faster sorts than TArray::Sort for typical struct sizes without sacrificing Blueprint compatibility.
Key Features
- Sort UObject pointer arrays (AActor*, UActorComponent*, UObject*) by any float key extracted via a Blueprint delegate, with automatic null and GC safety
- Sort geometry and value structs (FVector, FRotator, FTransform, FLinearColor, FColor) with multiple sort modes per type via 2-pass LSD Radix Sort
- Sort and search identity types (FName, FGuid, FDateTime) with quick, merge, linear, binary, and hash strategies
- Sort and search gameplay types (FGameplayTag, TSoftObjectPtr, TSoftClassPtr) with O(1) hash lookup after a single O(N) map build
- Generic USTRUCT sort via raw byte arrays — sorts any struct type at runtime without UE reflection overhead
- Built-in benchmark suite (UDSE_BenchmarkLib) measuring each algorithm against TArray::Sort baseline with Blueprint-readable per-entry results
Technical Decisions
Key extraction is separated from comparison: float sort keys are computed once per element in a pre-pass so the sort loop operates exclusively on dense float arrays with no struct or UObject access inside the hot path — this is what makes FLinearColor sorts peak at 8.3× faster than TArray::Sort at N=10K. A custom stack-slab linear allocator (FDSExposeLinearAllocator, 64 KB on desktop / 16 KB on mobile) eliminates heap allocations for arrays up to ~4,096 elements. UE 4/5 compatibility is centralised in a single version-macros header (DSA_VersionMacros.h), isolating double-precision FVector components in UE5 and TObjectPtr changes without scattering #if guards across the codebase.