Ir al contenido
Medios 1 para el artículo DSExpose extended- Search and Sort
0 comentarios

Descripción

DSExposeExtended is the second module of the DSExpose plugin. It exposes advanced sort and search algorithms to both C++ and Blueprints for UE types ecosystem: UObject pointer arrays, geometry structs, gameplay types, and generic USTRUCT byte arrays.

The base DSExpose module handles: int32, float, and FString. This module handles everything else.

Ships as two Runtime modules:

  • DSExpose (base) covers the three fundamental data types (int32, float, FString). A template layer implements Bubble Sort, Insertion Sort, iterative QuickSort, Merge Sort and Linear, Binary, and Hash search. A Blueprint Function Library layer return metadata structs (execution time, comparisons, swaps).

  • DSExposeExtended broadens coverage to every common UE type category:

    • Identity types — FName, FGuid, FDateTime

    • UObject pointer arrays — AActor*, UActorComponent*, UObject*, with safe null partitioning and delegate-driven key extraction

    • Geometric/value structs — FVector, FRotator, FQuat, FTransform, FLinearColor, FColor

    • Gameplay types — FGameplayTag, TSoftObjectPtr, TSoftClassPtr, and generic USTRUCT sorting via delegate comparators

    • Benchmarking — UDSE_BenchmarkLib measures all algorithms in-engine

A stack-scoped linear allocator (FDSExposeLinearAllocator) eliminates per-element heap traffic. Key extraction always precedes sorting so no UObject or struct logic runs inside the hot loop.

What the Extended Module Adds

The base module sorts and searches `int32 / float / FString` via four algorithms (Bubble, Insertion, QuickSort, MergeSort) and three search strategies (Linear, Binary, Hash).

DSExposeExtended adds:

- Key-extraction architecture — the sort key (a `float`) is computed once per element before sorting; the sort loop operates on dense float arrays only, eliminating repeated virtual calls inside comparators.

- 2-pass LSD Radix Sort on float keys — O(N), branchless, auto-vectorisable, 3–8× faster than introsort for struct sorts at N ≥ 2 000.

- Null-safe UObject handling — `DSE_UObjectNullPartition` segregates invalid/GC'd pointers before any algorithm runs; callers receive only valid sorted entries.

- Parallel key extraction — `DSE_ParallelKeyExtractionSort` distributes the extraction pass across UE task graph workers (threshold: N > 4 096).

- Stack scratch allocator (`FDSExposeLinearAllocator`) — 64 KB slab (16 KB mobile) eliminates per-element heap allocation on sort hot paths.

- Sort stability control — `EDSExposeSortStability::Stable` switches to MergeSort when equal-key ordering must be preserved.

- Blueprint diagnostics — `UDSE_BenchmarkLib::RunBenchmarkSuite()` returns a comparison table of all algorithms vs `TArray::Sort()` / `Algo::BinarySearch()`.

Type: Runtime module

Supported engine versions: UE 4.26 – 5.7

Depends on: DSExpose (base module), GameplayTags plugin (it is enabled by default in most projects).

📖Documentation: DSExpose-extended_docs

Formatos incluidos