tick: game steps read, clone and commit character rows through the store on the tick goroutine (about 12 ms a tick at 105 players)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 18/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- go
- 領域
- backend, performance
調査の方向性
Start from Ticker.runScheduledTick and Ticker.runDivision to see which game steps call store.ReadState through enterworld.Deps.Read and Deps.runCharacterUpdate, then follow the commit path (commitCheckedLocked, commitTxLocked, upsertTimedTx). Done means one shared read per character per tick, deferred updates where possible, a 100-player benchmark, and a live capture under 3 ms per tick. This needs store and tick-loop knowledge, so it is not a first task.
索引モデルが issue の本文から書いたものです。
説明
Live capture 2026-11-10 20:03Z on release 1dd0e9948 with 105 sessions attached (sro-tickbudget capture, loopback profiler): 954 ticks, 61.1 ms per tick (phase:total, exact from tick_zones), against the 10 ms target of #2150. CPU numbers below are the 30 s profile over the 301 ticks its bracketing snapshots count, stacks through Ticker.runScheduledTick or Ticker.runDivision only. At 18:00Z with 29 players the same server showed p99 60 ms; at 105 players p50 is 60 ms and p99 120 ms: these costs grow with players.
What costs
The action hook is 19.9 ms of the tick, and most of its CPU is the store, reached from game steps on the tick goroutine:
| Work on the tick goroutine | ms per tick |
|---|---|
store.ReadState (through enterworld.Deps.Read) |
7.1 |
character updates (Deps.runCharacterUpdate) |
5.1 |
commits inside those updates (commitCheckedLocked, commitTxLocked; upsertTimedTx 3.9) |
5.3 |
character clones (Character.snapshotWith, cloneCharacterFiltered) |
3.3 |
Who reads (share of the 7.1 ms): characterSnapshotCast 28%, companionPresentations 14%, questMarkerTick 11%, PopulationPlayers 9%, WorldSnapshotInto 8%, characterSnapshotCombatAdmitted 6%, monsterRewardRoster 5%, then a long tail. Who writes: Deps.Update is 70% of the update time (immediate), UpdateDeferred 18%, UpdateManyDeferred 8%.
The same character is read and cloned several times inside one tick by different steps, and an immediate Update pays a commit inside the tick. #2032 (ReadState 8% of tick CPU) and #2141 closed, and the cost is back at this load. The async writer of #2944 (SRO_STORE_ASYNC_COMMIT) is merged and off on the live shard.
Done when
- One read per character per tick: the steps of one tick share a snapshot instead of each calling
ReadState; a write in the tick invalidates it. The invariant is written where the cache lives. - Tick steps use the deferred update path unless a step proves it needs the row committed before the next step; each remaining immediate
Updateon the tick path is listed with its reason. - A benchmark at 100 synthetic players pins the store's share of the action hook, and the allocation budget test covers the clones.
- A live capture after release shows
ReadStateplus character updates under 3 ms per tick at about 100 players. - Separate owner decision, not part of the code: whether the live shard turns
SRO_STORE_ASYNC_COMMITon. Record the live numbers that argue for or against it here.
Part of #2150.
- 主要言語
- Go
- スター
- 97
- フォーク
- 61
- 平均マージ
- 4時間 14分
- マージ済み PR(30日)
- 913
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
opensro-dev/opensro のほかの issue
-
area: client enhancement priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
opensro-dev/opensro#3681 ·
メンテナーはふだん 1 日以内に返信
-
area: client bug priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
opensro-dev/opensro#3228 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Format one minified client file with dprint (ongoing: one file per PR)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea: client enhancement good first issue priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
opensro-dev/opensro#1 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area: server bug priority: medium
難易度 3/5 半日 初心者へのやさしさ 55/100
opensro-dev/opensro#3687 ·
メンテナーはふだん 1 日以内に返信
-
area: ops bug priority: high
難易度 4/5 3〜5日 初心者へのやさしさ 32/100
opensro-dev/opensro#3685 ·
メンテナーはふだん 1 日以内に返信
opensro-dev/opensro の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
unbound-force/gaze#353 ·
メンテナーはふだん 1 日以内に返信
-
bug cross-seed ready-for-human
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
OneBusAway/maglev#2102 ·
メンテナーはふだん 2 日以内に返信
-
affects-8.5 component/session severity/moderate sig/transaction type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
Waiting start: the fixed 503 body says another instance holds the lease when that may not be soオープン
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
Judgment-Pack/judgment-pack-gateway#474 ·
メンテナーはふだん 1 日以内に返信