wip(assembler): round L4 -- lazy per-thread caches: 17.3 MiB -> 43 KiB per thread, view 7% faster
VoxelForgeCoreThreadLocal::FLazy<T> (new public header ThreadLocalStorage.h) makes every large thread_local cache a pointer that heap-allocates on that thread's first use (still worker-private, lock-free). Static TLS 17.33 MiB -> 43 KiB (initialised image 5.8 MiB -> 21 KiB); worker start 5.2 -> 0.12 ms; idle worker RSS 17.7 MiB -> 52 KiB. Linux workers back to 8 MiB stacks. World unchanged (L1 hashes Clang off/GCC default, W1/W12; FloatingIslands seed 0). Reviewer interleaved W12: 2.256 -> 2.091 s. MSVC/UBT not compiled here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ED33VnqepD4YY6gDAAA832
This commit is contained in:
1 parent
046f2af495
commit
7770074503
15 files changed
+361
-48
No files matched your search
@@ -648,6 +648,7 @@ driven by `EditorBrush*` props.
|
||||
two global settings through `FVoxelOpContext` once per chunk, while `ClassifyBox`/`ClassifyTile`
|
||||
share the radial proof. This adds no cache, state, RNG, or clipmap stream, and does not touch the
|
||||
density grid's two-pass MC loop or any existing `thread_local` cache.
|
||||
- **Large `thread_local` caches are lazy** (`VoxelForgeCoreThreadLocal::FLazy<T>`, `Standalone/Core/include/VoxelForgeCore/ThreadLocalStorage.h`, round Linux4): the per-thread handle is a pointer; the table is heap-allocated on that thread's first use and freed at thread exit. Still worker-private and lock-free. It keeps the static TLS block at ~43 KiB instead of 17.3 MiB (glibc carves static TLS out of each thread's stack, and a Linux server pays it on every thread). New cache tables over a few KiB go through `FLazy`, never a bare `thread_local` array.
|
||||
- **Biome cache** (`ResolveBiomeSampleAt`/`FChunkBiomeCache`, §8.14): validity is a world-XY BOX +
|
||||
ChunkZ + Seed, NOT a chunk key — same reason as the SDF cache. The cell classification is
|
||||
noise-heavy; a chunk-key would thrash it on gradient-normal / +X/+Y boundary samples. Keep
|
||||
|
||||
Reference in new issue
Block a user