com.wallstop-studios.unity-helpers 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/format-on-demand.yml +2 -2
- package/.github/workflows/markdown-json.yml +1 -1
- package/.github/workflows/npm-publish.yml +1 -1
- package/.github/workflows/prettier-autofix.yml +4 -4
- package/.github/workflows/yaml-format-lint.yml +1 -1
- package/Docs/EFFECTS_SYSTEM.md +1316 -0
- package/{EFFECTS_SYSTEM_TUTORIAL.md → Docs/EFFECTS_SYSTEM_TUTORIAL.md} +1 -1
- package/{GETTING_STARTED.md → Docs/GETTING_STARTED.md} +10 -8
- package/{GLOSSARY.md → Docs/GLOSSARY.md} +4 -4
- package/Docs/HELPER_UTILITIES.md +885 -0
- package/Docs/HELPER_UTILITIES.md.meta +7 -0
- package/{INDEX.md → Docs/INDEX.md} +107 -62
- package/Docs/MATH_AND_EXTENSIONS.md +1039 -0
- package/{RANDOM_PERFORMANCE.md → Docs/RANDOM_PERFORMANCE.md} +15 -15
- package/{RELATIONAL_COMPONENTS.md → Docs/RELATIONAL_COMPONENTS.md} +21 -3
- package/{SPATIAL_TREES_2D_GUIDE.md → Docs/SPATIAL_TREES_2D_GUIDE.md} +2 -2
- package/{SPATIAL_TREES_3D_GUIDE.md → Docs/SPATIAL_TREES_3D_GUIDE.md} +1 -1
- package/{SPATIAL_TREE_2D_PERFORMANCE.md → Docs/SPATIAL_TREE_2D_PERFORMANCE.md} +64 -64
- package/{SPATIAL_TREE_3D_PERFORMANCE.md → Docs/SPATIAL_TREE_3D_PERFORMANCE.md} +64 -64
- package/Docs/UTILITY_COMPONENTS.md +906 -0
- package/Docs/UTILITY_COMPONENTS.md.meta +7 -0
- package/Docs/VISUAL_COMPONENTS.md +337 -0
- package/Docs/VISUAL_COMPONENTS.md.meta +7 -0
- package/Editor/Sprites/AnimationCopier.cs +3 -3
- package/README.md +69 -62
- package/Runtime/AssemblyInfo.cs +2 -0
- package/Runtime/Core/DataStructure/KDTree3D.cs +1 -1
- package/Runtime/Core/DataStructure/OctTree3D.cs +1 -1
- package/Runtime/Core/Extension/AsyncOperationExtensions.cs +122 -0
- package/Runtime/Core/Helper/Logging/UnityLogTagFormatter.cs +76 -90
- package/Runtime/Core/Serialization/ProtobufUnitySurrogates.cs +24 -29
- package/Runtime/Integrations/Reflex/AssemblyInfo.cs +7 -0
- package/Runtime/Integrations/Reflex/AssemblyInfo.cs.meta +11 -0
- package/Runtime/Integrations/Reflex/ContainerRelationalExtensions.cs +198 -0
- package/Runtime/Integrations/Reflex/ContainerRelationalExtensions.cs.meta +11 -0
- package/Runtime/Integrations/Reflex/RelationalComponentsInstaller.cs +86 -0
- package/Runtime/Integrations/Reflex/RelationalComponentsInstaller.cs.meta +11 -0
- package/Runtime/Integrations/Reflex/RelationalReflexSceneBootstrapper.cs +316 -0
- package/Runtime/Integrations/Reflex/RelationalReflexSceneBootstrapper.cs.meta +11 -0
- package/Runtime/Integrations/Reflex/RelationalSceneAssignmentOptions.cs +86 -0
- package/Runtime/Integrations/Reflex/RelationalSceneAssignmentOptions.cs.meta +11 -0
- package/Runtime/Integrations/Reflex/WallstopStudios.UnityHelpers.Integration.Reflex.asmdef +20 -0
- package/Runtime/Integrations/Reflex/WallstopStudios.UnityHelpers.Integration.Reflex.asmdef.meta +7 -0
- package/Runtime/Integrations/Reflex.meta +8 -0
- package/Runtime/Utils/ScriptableObjectSingleton.cs +1 -1
- package/Samples~/DI - Reflex/README.md +527 -0
- package/Samples~/DI - Reflex/README.md.meta +7 -0
- package/Samples~/DI - Reflex/Scripts/ReflexPaletteService.cs +36 -0
- package/Samples~/DI - Reflex/Scripts/ReflexPaletteService.cs.meta +11 -0
- package/Samples~/DI - Reflex/Scripts/ReflexRelationalConsumer.cs +79 -0
- package/Samples~/DI - Reflex/Scripts/ReflexRelationalConsumer.cs.meta +11 -0
- package/Samples~/DI - Reflex/Scripts/ReflexSampleInstaller.cs +30 -0
- package/Samples~/DI - Reflex/Scripts/ReflexSampleInstaller.cs.meta +11 -0
- package/Samples~/DI - Reflex/Scripts/ReflexSpawner.cs +79 -0
- package/Samples~/DI - Reflex/Scripts/ReflexSpawner.cs.meta +11 -0
- package/Samples~/DI - Reflex/Scripts/Samples.UnityHelpers.DI.Reflex.asmdef +26 -0
- package/Samples~/DI - Reflex/Scripts/Samples.UnityHelpers.DI.Reflex.asmdef.meta +9 -0
- package/Samples~/DI - Reflex/Scripts.meta +8 -0
- package/Samples~/DI - Reflex.meta +8 -0
- package/Samples~/DI - VContainer/README.md +6 -5
- package/Samples~/DI - Zenject/README.md +6 -5
- package/Tests/Editor/Core/Attributes/RelationalComponentAssignerTests.cs +29 -31
- package/Tests/Editor/Integrations/Reflex/ReflexIntegrationCompilationTests.cs +41 -0
- package/Tests/Editor/Integrations/Reflex/ReflexIntegrationCompilationTests.cs.meta +11 -0
- package/Tests/Editor/Integrations/Reflex/WallstopStudios.UnityHelpers.Tests.Editor.Reflex.asmdef +27 -0
- package/Tests/Editor/Integrations/Reflex/WallstopStudios.UnityHelpers.Tests.Editor.Reflex.asmdef.meta +7 -0
- package/Tests/Editor/Integrations/Reflex.meta +8 -0
- package/Tests/Editor/Integrations/VContainer/VContainerRelationalEntryPointTests.cs +15 -16
- package/Tests/Editor/Integrations/VContainer/VContainerRelationalHelpersTests.cs +7 -13
- package/Tests/Editor/Integrations/Zenject/ZenjectRelationalHelpersTests.cs +7 -11
- package/Tests/Editor/Integrations/Zenject/ZenjectRelationalInitializerTests.cs +19 -21
- package/Tests/Editor/PersistentDirectorySettingsTests.cs +0 -1
- package/Tests/Editor/Sprites/AnimationCopierFilterTests.cs +0 -1
- package/Tests/Editor/Sprites/AnimationViewerWindowTests.cs +2 -2
- package/Tests/Editor/Tools/ImageBlurToolTests.cs +1 -1
- package/Tests/Editor/Utils/CommonTestBase.cs +17 -0
- package/Tests/Editor/Utils/ScriptableObjectSingletonCreatorTests.cs +1 -1
- package/Tests/Runtime/Extensions/AsyncOperationExtensionsTests.cs +179 -0
- package/Tests/Runtime/Extensions/RandomExtensionTests.cs +55 -0
- package/Tests/Runtime/Extensions/UnityLogTagFormatterEdgeTests.cs +84 -0
- package/Tests/Runtime/Integrations/Reflex/RelationalComponentsReflexTests.cs +445 -0
- package/Tests/Runtime/Integrations/Reflex/RelationalComponentsReflexTests.cs.meta +11 -0
- package/Tests/Runtime/Integrations/Reflex/WallstopStudios.UnityHelpers.Tests.Runtime.Reflex.asmdef +28 -0
- package/Tests/Runtime/Integrations/Reflex/WallstopStudios.UnityHelpers.Tests.Runtime.Reflex.asmdef.meta +7 -0
- package/Tests/Runtime/Integrations/Reflex.meta +8 -0
- package/Tests/Runtime/Integrations/VContainer/RelationalComponentsVContainerTests.cs +24 -29
- package/Tests/Runtime/Integrations/VContainer/RelationalObjectPoolsVContainerTests.cs +8 -3
- package/Tests/Runtime/Integrations/Zenject/RelationalComponentsZenjectTests.cs +10 -20
- package/Tests/Runtime/Performance/RandomPerformanceTests.cs +1 -1
- package/Tests/Runtime/Performance/SpatialTree2DPerformanceTests.cs +1 -1
- package/Tests/Runtime/Performance/SpatialTree3DPerformanceTests.cs +1 -1
- package/Tests/Runtime/Serialization/JsonRoundtripComprehensiveTests.cs +4 -9
- package/Tests/Runtime/Serialization/ProtoRoundtripComprehensiveTests.cs +13 -13
- package/Tests/Runtime/TestUtils/CommonTestBase.cs +11 -0
- package/Tests/Runtime/TestUtils/ReflexTestSupport.cs +111 -0
- package/Tests/Runtime/TestUtils/ReflexTestSupport.cs.meta +12 -0
- package/Tests/Runtime/Utils/MatchColliderToSpriteTests.cs +4 -4
- package/Tests/TestUtils.meta +8 -0
- package/package.json +6 -1
- package/EFFECTS_SYSTEM.md +0 -242
- package/MATH_AND_EXTENSIONS.md +0 -316
- /package/{CHANGELOG.md → Docs/CHANGELOG.md} +0 -0
- /package/{CHANGELOG.md.meta → Docs/CHANGELOG.md.meta} +0 -0
- /package/{CONTRIBUTING.md → Docs/CONTRIBUTING.md} +0 -0
- /package/{CONTRIBUTING.md.meta → Docs/CONTRIBUTING.md.meta} +0 -0
- /package/{DATA_STRUCTURES.md → Docs/DATA_STRUCTURES.md} +0 -0
- /package/{DATA_STRUCTURES.md.meta → Docs/DATA_STRUCTURES.md.meta} +0 -0
- /package/{EDITOR_TOOLS_GUIDE.md → Docs/EDITOR_TOOLS_GUIDE.md} +0 -0
- /package/{EDITOR_TOOLS_GUIDE.md.meta → Docs/EDITOR_TOOLS_GUIDE.md.meta} +0 -0
- /package/{EFFECTS_SYSTEM.md.meta → Docs/EFFECTS_SYSTEM.md.meta} +0 -0
- /package/{EFFECTS_SYSTEM_TUTORIAL.md.meta → Docs/EFFECTS_SYSTEM_TUTORIAL.md.meta} +0 -0
- /package/{GETTING_STARTED.md.meta → Docs/GETTING_STARTED.md.meta} +0 -0
- /package/{GLOSSARY.md.meta → Docs/GLOSSARY.md.meta} +0 -0
- /package/{HULLS.md → Docs/HULLS.md} +0 -0
- /package/{HULLS.md.meta → Docs/HULLS.md.meta} +0 -0
- /package/{INDEX.md.meta → Docs/INDEX.md.meta} +0 -0
- /package/{LICENSE.md → Docs/LICENSE.md} +0 -0
- /package/{LICENSE.md.meta → Docs/LICENSE.md.meta} +0 -0
- /package/{MATH_AND_EXTENSIONS.md.meta → Docs/MATH_AND_EXTENSIONS.md.meta} +0 -0
- /package/{RANDOM_PERFORMANCE.md.meta → Docs/RANDOM_PERFORMANCE.md.meta} +0 -0
- /package/{REFLECTION_HELPERS.md → Docs/REFLECTION_HELPERS.md} +0 -0
- /package/{REFLECTION_HELPERS.md.meta → Docs/REFLECTION_HELPERS.md.meta} +0 -0
- /package/{RELATIONAL_COMPONENTS.md.meta → Docs/RELATIONAL_COMPONENTS.md.meta} +0 -0
- /package/{SERIALIZATION.md → Docs/SERIALIZATION.md} +0 -0
- /package/{SERIALIZATION.md.meta → Docs/SERIALIZATION.md.meta} +0 -0
- /package/{SINGLETONS.md → Docs/SINGLETONS.md} +0 -0
- /package/{SINGLETONS.md.meta → Docs/SINGLETONS.md.meta} +0 -0
- /package/{SPATIAL_TREES_2D_GUIDE.md.meta → Docs/SPATIAL_TREES_2D_GUIDE.md.meta} +0 -0
- /package/{SPATIAL_TREES_3D_GUIDE.md.meta → Docs/SPATIAL_TREES_3D_GUIDE.md.meta} +0 -0
- /package/{SPATIAL_TREE_2D_PERFORMANCE.md.meta → Docs/SPATIAL_TREE_2D_PERFORMANCE.md.meta} +0 -0
- /package/{SPATIAL_TREE_3D_PERFORMANCE.md.meta → Docs/SPATIAL_TREE_3D_PERFORMANCE.md.meta} +0 -0
- /package/{SPATIAL_TREE_SEMANTICS.md → Docs/SPATIAL_TREE_SEMANTICS.md} +0 -0
- /package/{SPATIAL_TREE_SEMANTICS.md.meta → Docs/SPATIAL_TREE_SEMANTICS.md.meta} +0 -0
- /package/{THIRD_PARTY_NOTICES.md → Docs/THIRD_PARTY_NOTICES.md} +0 -0
- /package/{THIRD_PARTY_NOTICES.md.meta → Docs/THIRD_PARTY_NOTICES.md.meta} +0 -0
|
@@ -81,18 +81,18 @@ This document contains performance benchmarks for the various random number gene
|
|
|
81
81
|
|
|
82
82
|
| Random | NextBool | Next | NextUInt | NextFloat | NextDouble | NextUint - Range | NextInt - Range |
|
|
83
83
|
| --------------------------- | ----------- | ----------- | ------------- | ----------- | ----------- | ---------------- | --------------- |
|
|
84
|
-
| DotNetRandom |
|
|
85
|
-
| LinearCongruentialGenerator |
|
|
86
|
-
| IllusionFlow |
|
|
87
|
-
| PcgRandom |
|
|
88
|
-
| RomuDuo |
|
|
89
|
-
| SplitMix64 |
|
|
90
|
-
| SquirrelRandom |
|
|
91
|
-
| SystemRandom |
|
|
92
|
-
| UnityRandom |
|
|
93
|
-
| WyRandom |
|
|
94
|
-
| XorShiftRandom |
|
|
95
|
-
| XoroShiroRandom |
|
|
84
|
+
| DotNetRandom | 550,600,000 | 53,100,000 | 57,400,000 | 45,600,000 | 26,900,000 | 53,700,000 | 53,900,000 |
|
|
85
|
+
| LinearCongruentialGenerator | 814,800,000 | 538,900,000 | 1,335,100,000 | 184,700,000 | 296,500,000 | 591,500,000 | 508,400,000 |
|
|
86
|
+
| IllusionFlow | 800,200,000 | 489,500,000 | 892,600,000 | 167,600,000 | 268,200,000 | 444,600,000 | 396,100,000 |
|
|
87
|
+
| PcgRandom | 796,400,000 | 537,900,000 | 889,500,000 | 184,300,000 | 291,400,000 | 456,500,000 | 412,000,000 |
|
|
88
|
+
| RomuDuo | 794,300,000 | 359,300,000 | 766,200,000 | 167,200,000 | 191,600,000 | 446,000,000 | 397,600,000 |
|
|
89
|
+
| SplitMix64 | 801,100,000 | 537,400,000 | 972,300,000 | 183,800,000 | 296,600,000 | 487,500,000 | 446,600,000 |
|
|
90
|
+
| SquirrelRandom | 747,700,000 | 383,300,000 | 413,800,000 | 172,300,000 | 204,800,000 | 330,200,000 | 314,200,000 |
|
|
91
|
+
| SystemRandom | 146,800,000 | 148,300,000 | 65,700,000 | 132,500,000 | 139,500,000 | 59,800,000 | 61,300,000 |
|
|
92
|
+
| UnityRandom | 647,700,000 | 77,800,000 | 87,800,000 | 62,100,000 | 39,500,000 | 81,500,000 | 82,400,000 |
|
|
93
|
+
| WyRandom | 750,700,000 | 382,900,000 | 447,500,000 | 166,800,000 | 191,700,000 | 296,800,000 | 281,100,000 |
|
|
94
|
+
| XorShiftRandom | 792,900,000 | 536,400,000 | 606,000,000 | 184,100,000 | 287,300,000 | 442,800,000 | 391,200,000 |
|
|
95
|
+
| XoroShiroRandom | 789,200,000 | 359,300,000 | 715,100,000 | 167,300,000 | 192,500,000 | 428,900,000 | 383,500,000 |
|
|
96
96
|
|
|
97
97
|
<!-- RANDOM_BENCHMARKS_END -->
|
|
98
98
|
|
|
@@ -124,13 +124,13 @@ All benchmarks are run for 1 second per operation type to ensure statistical sig
|
|
|
124
124
|
**Core Guides:**
|
|
125
125
|
|
|
126
126
|
- [Getting Started](GETTING_STARTED.md) - Your first 5 minutes with Unity Helpers
|
|
127
|
-
- [Main README](README.md) - Complete feature overview
|
|
127
|
+
- [Main README](../README.md) - Complete feature overview
|
|
128
128
|
- [Feature Index](INDEX.md) - Alphabetical reference
|
|
129
129
|
|
|
130
130
|
**Random Number Generator Features:**
|
|
131
131
|
|
|
132
|
-
- [README - Random Generators](README.md#random-number-generators) - Full API reference
|
|
133
|
-
- [README - Quick Start](README.md#random-number-generation) - 60-second tutorial
|
|
132
|
+
- [README - Random Generators](../README.md#random-number-generators) - Full API reference
|
|
133
|
+
- [README - Quick Start](../README.md#random-number-generation) - 60-second tutorial
|
|
134
134
|
|
|
135
135
|
**Related Features:**
|
|
136
136
|
|
|
@@ -314,7 +314,7 @@ Notes:
|
|
|
314
314
|
|
|
315
315
|
## Dependency Injection Integrations
|
|
316
316
|
|
|
317
|
-
**Stop choosing between DI and clean hierarchy references** - Unity Helpers provides seamless integrations with Zenject and
|
|
317
|
+
**Stop choosing between DI and clean hierarchy references** - Unity Helpers provides seamless integrations with Zenject/Extenject, VContainer, and Reflex that automatically wire up your relational component fields right after dependency injection completes.
|
|
318
318
|
|
|
319
319
|
### The DI Pain Point
|
|
320
320
|
|
|
@@ -365,17 +365,19 @@ Unity Helpers automatically detects these packages via UPM:
|
|
|
365
365
|
|
|
366
366
|
- **Zenject/Extenject**: `com.extenject.zenject`, `com.modesttree.zenject`, `com.svermeulen.extenject`
|
|
367
367
|
- **VContainer**: `jp.cysharp.vcontainer`, `jp.hadashikick.vcontainer`
|
|
368
|
+
- **Reflex**: `com.gustavopsantos.reflex`
|
|
368
369
|
|
|
369
370
|
> 💡 **UPM packages work out-of-the-box** - No scripting defines needed!
|
|
370
371
|
|
|
371
372
|
### Manual or Source Imports (Non-UPM)
|
|
372
373
|
|
|
373
|
-
If you import Zenject/VContainer as source code, .unitypackage, or raw DLLs (not via UPM), you need to manually add scripting defines:
|
|
374
|
+
If you import Zenject/VContainer/Reflex as source code, .unitypackage, or raw DLLs (not via UPM), you need to manually add scripting defines:
|
|
374
375
|
|
|
375
376
|
1. Open `Project Settings > Player > Other Settings > Scripting Define Symbols`
|
|
376
377
|
2. Add the appropriate define(s) for your target platforms:
|
|
377
378
|
- `ZENJECT_PRESENT` - When using Zenject/Extenject
|
|
378
379
|
- `VCONTAINER_PRESENT` - When using VContainer
|
|
380
|
+
- `REFLEX_PRESENT` - When using Reflex
|
|
379
381
|
3. Unity will recompile and the integration assemblies under `Runtime/Integrations/*` will activate automatically
|
|
380
382
|
|
|
381
383
|
### VContainer at a Glance
|
|
@@ -411,6 +413,22 @@ If you import Zenject/VContainer as source code, .unitypackage, or raw DLLs (not
|
|
|
411
413
|
|
|
412
414
|
- **Full walkthrough**: [DI – Zenject sample](Samples~/DI%20-%20Zenject/README.md)
|
|
413
415
|
|
|
416
|
+
### Reflex at a Glance
|
|
417
|
+
|
|
418
|
+
- **Install once per scene**
|
|
419
|
+
- Reflex creates a `SceneScope` in each scene. Add `RelationalComponentsInstaller` to the same GameObject (or a child) to bind the relational assigner, run the initial scene scan, and optionally register the additive-scene listener.
|
|
420
|
+
- Toggles mirror the runtime helpers: include inactive objects, choose scan strategy, and enable additive listening.
|
|
421
|
+
|
|
422
|
+
- **Runtime helpers**
|
|
423
|
+
- `_container.InjectWithRelations(existingComponent)` to inject DI fields and hydrate relational attributes on existing objects.
|
|
424
|
+
- `_container.InstantiateComponentWithRelations(componentPrefab, parent)` for component prefabs.
|
|
425
|
+
- `_container.InstantiateGameObjectWithRelations(rootPrefab, parent, includeInactiveChildren: true)` for full hierarchies.
|
|
426
|
+
- `_container.AssignRelationalHierarchy(existingRoot, includeInactiveChildren: true)` to hydrate arbitrary hierarchies after manual instantiation.
|
|
427
|
+
|
|
428
|
+
- **Full walkthrough**: [DI – Reflex sample](Samples~/DI%20-%20Reflex/README.md)
|
|
429
|
+
|
|
430
|
+
- Reflex shares the same fallback behaviour: if the assigner is not bound, the helpers call `AssignRelationalComponents()` directly so you can adopt incrementally.
|
|
431
|
+
|
|
414
432
|
Notes
|
|
415
433
|
|
|
416
434
|
- Both integrations fall back to the built-in `component.AssignRelationalComponents()` call path if the DI container does not expose the assigner binding, so you can adopt them incrementally without breaking existing behaviour.
|
|
@@ -535,7 +553,7 @@ Common pitfalls and how to avoid them
|
|
|
535
553
|
**Core Guides:**
|
|
536
554
|
|
|
537
555
|
- [Getting Started](GETTING_STARTED.md) - Your first 5 minutes with Unity Helpers
|
|
538
|
-
- [Main README](README.md) - Complete feature overview
|
|
556
|
+
- [Main README](../README.md) - Complete feature overview
|
|
539
557
|
- [Feature Index](INDEX.md) - Alphabetical reference
|
|
540
558
|
|
|
541
559
|
**Related Features:**
|
|
@@ -177,7 +177,7 @@ void Update()
|
|
|
177
177
|
}
|
|
178
178
|
```
|
|
179
179
|
|
|
180
|
-
See [Buffering Pattern](README.md#buffering-pattern) for the complete guide and [Pooling Utilities](README.md#pooling-utilities) for more pooling options.
|
|
180
|
+
See [Buffering Pattern](../README.md#buffering-pattern) for the complete guide and [Pooling Utilities](../README.md#pooling-utilities) for more pooling options.
|
|
181
181
|
|
|
182
182
|
## Structures
|
|
183
183
|
|
|
@@ -247,7 +247,7 @@ START: Do your objects move frequently?
|
|
|
247
247
|
- **Nearest neighbors on static points:** KDTree2D (Balanced)
|
|
248
248
|
- **Fast builds with good-enough queries:** KDTree2D (Unbalanced)
|
|
249
249
|
- **Objects with area; bounds queries primary:** RTree2D
|
|
250
|
-
- **Very frequent movement (every frame):** SpatialHash2D (see [README](README.md#choosing-spatial-structures))
|
|
250
|
+
- **Very frequent movement (every frame):** SpatialHash2D (see [README](../README.md#choosing-spatial-structures))
|
|
251
251
|
|
|
252
252
|
## Query Semantics
|
|
253
253
|
|
|
@@ -167,7 +167,7 @@ void Update()
|
|
|
167
167
|
}
|
|
168
168
|
```
|
|
169
169
|
|
|
170
|
-
See [Buffering Pattern](README.md#buffering-pattern) for the complete guide and [Pooling Utilities](README.md#pooling-utilities) for more pooling options.
|
|
170
|
+
See [Buffering Pattern](../README.md#buffering-pattern) for the complete guide and [Pooling Utilities](../README.md#pooling-utilities) for more pooling options.
|
|
171
171
|
|
|
172
172
|
## Structures
|
|
173
173
|
|
|
@@ -32,34 +32,34 @@ This document contains performance benchmarks for the 2D spatial tree implementa
|
|
|
32
32
|
|
|
33
33
|
| Construction | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
|
|
34
34
|
| ----------------- | ------------------- | --------------------- | ---------- | ---------- |
|
|
35
|
-
| 1,000,000 entries |
|
|
35
|
+
| 1,000,000 entries | 3 (0.325s) | 4 (0.218s) | 4 (0.221s) | 1 (0.595s) |
|
|
36
36
|
|
|
37
37
|
##### Elements In Range
|
|
38
38
|
|
|
39
39
|
| Elements In Range | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
|
|
40
40
|
| --------------------------- | ------------------- | --------------------- | ---------- | ------- |
|
|
41
|
-
| Full (~span/2) (r=499.5) |
|
|
42
|
-
| Half (~span/4) (r=249.8) |
|
|
43
|
-
| Quarter (~span/8) (r=124.9) |
|
|
44
|
-
| Tiny (~span/1000) (r=1) | 103,
|
|
41
|
+
| Full (~span/2) (r=499.5) | 58 | 58 | 56 | 7 |
|
|
42
|
+
| Half (~span/4) (r=249.8) | 236 | 238 | 215 | 28 |
|
|
43
|
+
| Quarter (~span/8) (r=124.9) | 945 | 946 | 815 | 119 |
|
|
44
|
+
| Tiny (~span/1000) (r=1) | 103,233 | 105,580 | 142,838 | 107,126 |
|
|
45
45
|
|
|
46
46
|
##### Get Elements In Bounds
|
|
47
47
|
|
|
48
48
|
| Get Elements In Bounds | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
|
|
49
49
|
| -------------------------- | ------------------- | --------------------- | ---------- | ------- |
|
|
50
|
-
| Full (size=999.0x999.0) |
|
|
51
|
-
| Half (size=499.5x499.5) | 1,
|
|
52
|
-
| Quarter (size=249.8x249.8) | 7,
|
|
53
|
-
| Unit (size=1) |
|
|
50
|
+
| Full (size=999.0x999.0) | 314 | 325 | 344 | 17 |
|
|
51
|
+
| Half (size=499.5x499.5) | 1,730 | 1,822 | 1,238 | 73 |
|
|
52
|
+
| Quarter (size=249.8x249.8) | 7,188 | 7,170 | 3,867 | 379 |
|
|
53
|
+
| Unit (size=1) | 149,753 | 153,363 | 197,026 | 113,010 |
|
|
54
54
|
|
|
55
55
|
##### Approximate Nearest Neighbors
|
|
56
56
|
|
|
57
57
|
| Approximate Nearest Neighbors | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
|
|
58
58
|
| ----------------------------- | ------------------- | --------------------- | ---------- | ------- |
|
|
59
|
-
| 500 neighbors | 8,
|
|
60
|
-
| 100 neighbors |
|
|
61
|
-
| 10 neighbors |
|
|
62
|
-
| 1 neighbor |
|
|
59
|
+
| 500 neighbors | 8,466 | 16,873 | 12,696 | 70,046 |
|
|
60
|
+
| 100 neighbors | 78,952 | 76,476 | 78,720 | 171,372 |
|
|
61
|
+
| 10 neighbors | 375,484 | 377,708 | 251,988 | 277,491 |
|
|
62
|
+
| 1 neighbor | 551,002 | 508,239 | 276,379 | 299,010 |
|
|
63
63
|
|
|
64
64
|
#### **100,000 entries**
|
|
65
65
|
|
|
@@ -67,34 +67,34 @@ This document contains performance benchmarks for the 2D spatial tree implementa
|
|
|
67
67
|
|
|
68
68
|
| Construction | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
|
|
69
69
|
| --------------- | ------------------- | --------------------- | ----------- | ----------- |
|
|
70
|
-
| 100,000 entries |
|
|
70
|
+
| 100,000 entries | 50 (0.020s) | 83 (0.012s) | 50 (0.020s) | 49 (0.020s) |
|
|
71
71
|
|
|
72
72
|
##### Elements In Range
|
|
73
73
|
|
|
74
74
|
| Elements In Range | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
|
|
75
75
|
| --------------------------- | ------------------- | --------------------- | ---------- | ------- |
|
|
76
|
-
| Full (~span/2) (r=199.5) |
|
|
77
|
-
| Half (~span/4) (r=99.75) | 1,
|
|
78
|
-
| Quarter (~span/8) (r=49.88) | 4,672 | 5,
|
|
79
|
-
| Tiny (~span/1000) (r=1) | 127,
|
|
76
|
+
| Full (~span/2) (r=199.5) | 602 | 602 | 600 | 73 |
|
|
77
|
+
| Half (~span/4) (r=99.75) | 1,355 | 1,359 | 1,248 | 185 |
|
|
78
|
+
| Quarter (~span/8) (r=49.88) | 4,672 | 5,178 | 4,300 | 723 |
|
|
79
|
+
| Tiny (~span/1000) (r=1) | 127,810 | 128,060 | 179,544 | 145,029 |
|
|
80
80
|
|
|
81
81
|
##### Get Elements In Bounds
|
|
82
82
|
|
|
83
83
|
| Get Elements In Bounds | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
|
|
84
84
|
| -------------------------- | ------------------- | --------------------- | ---------- | ------- |
|
|
85
|
-
| Full (size=399.0x249.0) | 4,
|
|
86
|
-
| Half (size=199.5x124.5) | 9,
|
|
87
|
-
| Quarter (size=99.75x62.25) | 25,
|
|
88
|
-
| Unit (size=1) | 184,
|
|
85
|
+
| Full (size=399.0x249.0) | 4,436 | 4,468 | 4,702 | 235 |
|
|
86
|
+
| Half (size=199.5x124.5) | 9,433 | 11,669 | 7,996 | 967 |
|
|
87
|
+
| Quarter (size=99.75x62.25) | 25,419 | 32,186 | 19,754 | 3,805 |
|
|
88
|
+
| Unit (size=1) | 184,712 | 185,636 | 245,390 | 155,220 |
|
|
89
89
|
|
|
90
90
|
##### Approximate Nearest Neighbors
|
|
91
91
|
|
|
92
92
|
| Approximate Nearest Neighbors | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
|
|
93
93
|
| ----------------------------- | ------------------- | --------------------- | ---------- | ------- |
|
|
94
|
-
| 500 neighbors | 9,
|
|
95
|
-
| 100 neighbors | 49,
|
|
96
|
-
| 10 neighbors |
|
|
97
|
-
| 1 neighbor |
|
|
94
|
+
| 500 neighbors | 9,986 | 9,929 | 11,705 | 69,966 |
|
|
95
|
+
| 100 neighbors | 49,779 | 87,233 | 55,229 | 233,211 |
|
|
96
|
+
| 10 neighbors | 470,175 | 394,286 | 294,299 | 352,517 |
|
|
97
|
+
| 1 neighbor | 509,623 | 544,160 | 314,046 | 350,724 |
|
|
98
98
|
|
|
99
99
|
#### **10,000 entries**
|
|
100
100
|
|
|
@@ -102,34 +102,34 @@ This document contains performance benchmarks for the 2D spatial tree implementa
|
|
|
102
102
|
|
|
103
103
|
| Construction | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
|
|
104
104
|
| -------------- | ------------------- | --------------------- | ------------ | ------------ |
|
|
105
|
-
| 10,000 entries |
|
|
105
|
+
| 10,000 entries | 533 (0.002s) | 796 (0.001s) | 408 (0.002s) | 507 (0.002s) |
|
|
106
106
|
|
|
107
107
|
##### Elements In Range
|
|
108
108
|
|
|
109
109
|
| Elements In Range | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
|
|
110
110
|
| --------------------------- | ------------------- | --------------------- | ---------- | ------- |
|
|
111
|
-
| Full (~span/2) (r=49.50) | 5,
|
|
112
|
-
| Half (~span/4) (r=24.75) | 22,
|
|
113
|
-
| Quarter (~span/8) (r=12.38) | 44,
|
|
114
|
-
| Tiny (~span/1000) (r=1) | 167,
|
|
111
|
+
| Full (~span/2) (r=49.50) | 5,944 | 5,941 | 5,936 | 735 |
|
|
112
|
+
| Half (~span/4) (r=24.75) | 22,272 | 22,233 | 13,861 | 2,919 |
|
|
113
|
+
| Quarter (~span/8) (r=12.38) | 44,278 | 51,526 | 38,041 | 12,217 |
|
|
114
|
+
| Tiny (~span/1000) (r=1) | 167,798 | 162,582 | 223,371 | 168,224 |
|
|
115
115
|
|
|
116
116
|
##### Get Elements In Bounds
|
|
117
117
|
|
|
118
118
|
| Get Elements In Bounds | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
|
|
119
119
|
| -------------------------- | ------------------- | --------------------- | ---------- | ------- |
|
|
120
|
-
| Full (size=99.00x99.00) |
|
|
121
|
-
| Half (size=49.50x49.50) | 167,
|
|
122
|
-
| Quarter (size=24.75x24.75) |
|
|
123
|
-
| Unit (size=1) |
|
|
120
|
+
| Full (size=99.00x99.00) | 45,222 | 44,244 | 47,466 | 2,412 |
|
|
121
|
+
| Half (size=49.50x49.50) | 167,135 | 166,097 | 36,985 | 9,274 |
|
|
122
|
+
| Quarter (size=24.75x24.75) | 76,007 | 104,425 | 74,227 | 35,573 |
|
|
123
|
+
| Unit (size=1) | 242,092 | 234,546 | 320,164 | 181,677 |
|
|
124
124
|
|
|
125
125
|
##### Approximate Nearest Neighbors
|
|
126
126
|
|
|
127
127
|
| Approximate Nearest Neighbors | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
|
|
128
128
|
| ----------------------------- | ------------------- | --------------------- | ---------- | ------- |
|
|
129
|
-
| 500 neighbors | 13,
|
|
130
|
-
| 100 neighbors | 62,
|
|
131
|
-
| 10 neighbors |
|
|
132
|
-
| 1 neighbor |
|
|
129
|
+
| 500 neighbors | 13,178 | 12,888 | 14,441 | 65,299 |
|
|
130
|
+
| 100 neighbors | 62,415 | 57,120 | 96,738 | 235,553 |
|
|
131
|
+
| 10 neighbors | 418,552 | 392,340 | 316,886 | 420,625 |
|
|
132
|
+
| 1 neighbor | 595,519 | 632,000 | 372,667 | 433,485 |
|
|
133
133
|
|
|
134
134
|
#### **1,000 entries**
|
|
135
135
|
|
|
@@ -137,34 +137,34 @@ This document contains performance benchmarks for the 2D spatial tree implementa
|
|
|
137
137
|
|
|
138
138
|
| Construction | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
|
|
139
139
|
| ------------- | ------------------- | --------------------- | -------------- | -------------- |
|
|
140
|
-
| 1,000 entries |
|
|
140
|
+
| 1,000 entries | 4,672 (0.000s) | 5,611 (0.000s) | 4,847 (0.000s) | 4,764 (0.000s) |
|
|
141
141
|
|
|
142
142
|
##### Elements In Range
|
|
143
143
|
|
|
144
144
|
| Elements In Range | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
|
|
145
145
|
| -------------------------- | ------------------- | --------------------- | ---------- | ------- |
|
|
146
|
-
| Full (~span/2) (r=24.50) | 58,
|
|
147
|
-
| Half (~span/4) (r=12.25) | 60,
|
|
148
|
-
| Quarter (~span/8) (r=6.13) | 95,
|
|
149
|
-
| Tiny (~span/1000) (r=1) | 239,
|
|
146
|
+
| Full (~span/2) (r=24.50) | 58,142 | 56,029 | 57,082 | 7,394 |
|
|
147
|
+
| Half (~span/4) (r=12.25) | 60,439 | 76,572 | 57,123 | 14,698 |
|
|
148
|
+
| Quarter (~span/8) (r=6.13) | 95,988 | 108,457 | 95,703 | 37,920 |
|
|
149
|
+
| Tiny (~span/1000) (r=1) | 239,460 | 237,275 | 333,071 | 251,518 |
|
|
150
150
|
|
|
151
151
|
##### Get Elements In Bounds
|
|
152
152
|
|
|
153
153
|
| Get Elements In Bounds | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
|
|
154
154
|
| ------------------------- | ------------------- | --------------------- | ---------- | ------- |
|
|
155
|
-
| Full (size=49.00x19.00) | 499,
|
|
156
|
-
| Half (size=24.50x9.5) |
|
|
157
|
-
| Quarter (size=12.25x4.75) | 271,
|
|
158
|
-
| Unit (size=1) |
|
|
155
|
+
| Full (size=49.00x19.00) | 499,193 | 498,444 | 508,596 | 24,141 |
|
|
156
|
+
| Half (size=24.50x9.5) | 167,532 | 291,283 | 126,274 | 75,139 |
|
|
157
|
+
| Quarter (size=12.25x4.75) | 271,878 | 288,421 | 194,135 | 176,768 |
|
|
158
|
+
| Unit (size=1) | 342,402 | 339,166 | 460,883 | 281,383 |
|
|
159
159
|
|
|
160
160
|
##### Approximate Nearest Neighbors
|
|
161
161
|
|
|
162
162
|
| Approximate Nearest Neighbors | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
|
|
163
163
|
| ----------------------------- | ------------------- | --------------------- | ---------- | ------- |
|
|
164
|
-
| 500 neighbors | 46,
|
|
165
|
-
| 100 neighbors |
|
|
166
|
-
| 10 neighbors |
|
|
167
|
-
| 1 neighbor |
|
|
164
|
+
| 500 neighbors | 46,434 | 47,214 | 40,048 | 70,543 |
|
|
165
|
+
| 100 neighbors | 80,837 | 77,933 | 91,884 | 267,760 |
|
|
166
|
+
| 10 neighbors | 487,252 | 574,172 | 426,710 | 516,096 |
|
|
167
|
+
| 1 neighbor | 754,604 | 618,120 | 404,966 | 594,659 |
|
|
168
168
|
|
|
169
169
|
#### **100 entries**
|
|
170
170
|
|
|
@@ -172,33 +172,33 @@ This document contains performance benchmarks for the 2D spatial tree implementa
|
|
|
172
172
|
|
|
173
173
|
| Construction | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
|
|
174
174
|
| ------------ | ------------------- | --------------------- | --------------- | --------------- |
|
|
175
|
-
| 100 entries |
|
|
175
|
+
| 100 entries | 37,174 (0.000s) | 3,938 (0.000s) | 10,384 (0.000s) | 21,978 (0.000s) |
|
|
176
176
|
|
|
177
177
|
##### Elements In Range
|
|
178
178
|
|
|
179
179
|
| Elements In Range | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
|
|
180
180
|
| -------------------------- | ------------------- | --------------------- | ---------- | ------- |
|
|
181
|
-
| Full (~span/2) (r=4.5) |
|
|
182
|
-
| Half (~span/4) (r=2.25) |
|
|
183
|
-
| Quarter (~span/8) (r=1.13) |
|
|
184
|
-
| Tiny (~span/1000) (r=1) |
|
|
181
|
+
| Full (~span/2) (r=4.5) | 505,197 | 462,582 | 480,895 | 72,679 |
|
|
182
|
+
| Half (~span/4) (r=2.25) | 428,579 | 432,700 | 256,227 | 233,286 |
|
|
183
|
+
| Quarter (~span/8) (r=1.13) | 422,859 | 432,362 | 601,655 | 318,360 |
|
|
184
|
+
| Tiny (~span/1000) (r=1) | 406,482 | 433,055 | 601,161 | 339,515 |
|
|
185
185
|
|
|
186
186
|
##### Get Elements In Bounds
|
|
187
187
|
|
|
188
188
|
| Get Elements In Bounds | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
|
|
189
189
|
| ------------------------ | ------------------- | --------------------- | ---------- | ------- |
|
|
190
|
-
| Full (size=9x9) | 2,
|
|
191
|
-
| Half (size=4.5x4.5) |
|
|
192
|
-
| Quarter (size=2.25x2.25) |
|
|
193
|
-
| Unit (size=1) |
|
|
190
|
+
| Full (size=9x9) | 2,460,211 | 2,459,261 | 2,542,373 | 223,694 |
|
|
191
|
+
| Half (size=4.5x4.5) | 572,726 | 561,349 | 365,082 | 372,098 |
|
|
192
|
+
| Quarter (size=2.25x2.25) | 594,157 | 580,857 | 738,232 | 396,288 |
|
|
193
|
+
| Unit (size=1) | 593,669 | 576,995 | 787,477 | 395,564 |
|
|
194
194
|
|
|
195
195
|
##### Approximate Nearest Neighbors
|
|
196
196
|
|
|
197
197
|
| Approximate Nearest Neighbors | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
|
|
198
198
|
| ----------------------------- | ------------------- | --------------------- | ---------- | ------- |
|
|
199
|
-
| 100 neighbors (max) |
|
|
200
|
-
| 10 neighbors |
|
|
201
|
-
| 1 neighbor |
|
|
199
|
+
| 100 neighbors (max) | 166,728 | 165,861 | 199,072 | 303,148 |
|
|
200
|
+
| 10 neighbors | 610,079 | 520,568 | 639,716 | 735,646 |
|
|
201
|
+
| 1 neighbor | 457,409 | 765,967 | 667,953 | 818,651 |
|
|
202
202
|
|
|
203
203
|
<!-- tabs:end -->
|
|
204
204
|
<!-- SPATIAL_TREE_BENCHMARKS_END -->
|