Repository navigation
Read mp_slammoveyaw directly in the 9-way move yaw - #2237
Closed
sunzenshen wants to merge 2 commits into
Closed
sunzenshen wants to merge 2 commits into
sunzenshen wants to merge 2 commits into
Conversation
CHL2MPPlayerAnimState::ComputePoseParam_MoveYaw built a ConVarRef by name on every call, so every player's every usercmd on the server (and every frame on the client) did a linear CCvar::FindVar walk over all registered cvars. The ConVar is defined in multiplayer_animstate.cpp, which both DLLs compile, so refer to it with extern instead. The value read is the same; only the lookup goes away. Co-authored-by: Mikhail Bogdanov <Masterkatze@users.noreply.github.com>
Keep the stock SDK code path unchanged outside NEO builds: only NEO reads the ConVar directly, other builds keep the by-name lookup.
Contributor
|
wowee like +50 fps on isolation with 22 bots (edit) well the fps counter is difficult to read, 50 fps might be a bit much but definitely a significant improvement |
Contributor
|
also no ifdef NEOs, but I understand this is a draft pr and imagine you will want to move this into neoplayeranimstate anyway |
Contributor
Author
Contributor
Author
|
(Have a backup in case we need this again, but is likely obviated by #2244.) |
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.
Description
ComputePoseParam_MoveYawconstructs aConVarRefon every call, causing a name lookup for each player update. This change reads the existingmp_slammoveyawConVar directly. It still reads the live value, so changing the cvar takes effect immediately and animation behavior is unchanged.Testing: On a Linux Release dedicated server, the function's measured time fell from 9.6 to 0.44 microseconds per call. Server frame time fell from 1.01 to 0.86 milliseconds in the paired run. All 30 Release matches and three Debug matches ended with no asserts. Checked that
mp_slammoveyawstill toggles move-yaw snapping.Toolchain
Linked Issues