Skip to content

perf(server): read the tick clock once per frame - #4224

Open
wall3rsyt wants to merge 1 commit into
citizenfx:masterfrom
wall3rsyt:perf/server-tick-clock
Open

wall3rsyt wants to merge 1 commit into
citizenfx:masterfrom
wall3rsyt:perf/server-tick-clock

Conversation

@wall3rsyt

Copy link
Copy Markdown

What

The server tick loops (WithProcessTick and the GameServer main loop) call msec() twice per iteration. This reads the clock once and reuses it for lastTime.

Why / impact

Saves one clock read per tick and ensures time spent between the two reads (hitch warning trace, clamping) is accounted for in the next frame instead of being dropped.

Trade-offs

None expected; frame timing semantics are otherwise unchanged.

Testing

Not compiled locally: the server projects are not part of the client (-game five) solution used for testing.

🤖 Generated with Claude Code

The server tick loops called msec() twice per iteration. Reuse the value
read at the start of the frame so time spent in the hitch warning and
clamping isn't silently dropped from the frame budget.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid Requires changes before it's considered valid and can be (re)triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant