Repository navigation
perf(world): write immediate spawns in place - #13
Merged
Merged
Conversation
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://feat-step8-in-place-spawn-archevolt.hayman.workers.dev (commit 55e02fd)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Roadmap step 8.
World.Spawn<TBundle>andWorld.SpawnBatch<TBundle>no longer stage each bundle in a buffer and copy it into the table. They append the row first, and the bundle'sWritestores each member directly in its destination column.Change
BundleWriterhas two targets. The staging form is unchanged and still servesCommandsandInsertBundle. The new table form writes each member into its column throughBundleBinding.Columnsand stamps tracked ticks.WriteorCompletethrows,Spawntruncates the row and releases the reservation, asSpawnBatchalready did for the whole batch. The change tick advances only after a successful write.Writeruns, the new row is in the table but not yet in the entity directory, so the world counts as running for that window. A bundle whoseWritereaches the same world now throws, instead of moving or truncating the row being written. The old staging path did not need this guard.Measurements
Six interleaved process runs, with before at
1ea88b7. Medians in µs; full conditions and ranges are inbenchmarks/step8-in-place-spawn.md.Spawn, 1,000Spawn, 100,000SpawnBatch, 1,000SpawnBatch, 100,000Managed allocation is unchanged. Despawn,
Get<T>, and the round trips run no changed code, and they moved within ±5%.Gate
Spawn_that_fails_partway_leaves_no_row_or_reservationandBundle_write_cannot_spawn_into_the_world_it_is_writing_to.scripts/verify.ps1passes locally.🤖 Generated with Claude Code