tick: game steps read, clone and commit character rows through the store on the tick goroutine (about 12 ms a tick at 105 players)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 18/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go
- Lĩnh vực
- backend, performance
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 97
- Fork
- 61
- Merge trung bình
- 4 giờ 14 phút
- Pull request đã merge (30 ngày)
- 913
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của opensro-dev/opensro
-
area: client enhancement priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
opensro-dev/opensro#3681 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: client bug priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
opensro-dev/opensro#3228 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Format one minified client file with dprint (ongoing: one file per PR)Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởarea: client enhancement good first issue priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
opensro-dev/opensro#1 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: server bug priority: medium
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 55/100
opensro-dev/opensro#3687 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: ops bug priority: high
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 32/100
opensro-dev/opensro#3685 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của opensro-dev/opensro
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
unbound-force/gaze#353 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug cross-seed ready-for-human
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
OneBusAway/maglev#2102 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
affects-8.5 component/session severity/moderate sig/transaction type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Waiting start: the fixed 503 body says another instance holds the lease when that may not be soĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
Judgment-Pack/judgment-pack-gateway#474 ·
Maintainer thường phản hồi trong vòng 1 ngày