-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SV_Physics() : Performance boost for SV_PushMove() when there is a lot of pushers and pushed entities. #731
Conversation
e03f216
to
d8d896e
Compare
I've found a good use case to trigger eventual problems, with lots of dynamically spawned items : Rotting Jam map |
9141dbf
to
3430a40
Compare
not sure if this is really related to that branch. They are stuck in the air, but still alive. |
7c94e87
to
a596fb3
Compare
…erformance when level has a ton of edicts to process (again for The Immortal Lock, our new favorite benchmark) - Added sv_fastpushmove CVAR (default = 0, archived) to control optimized SV_PushMove processing
a596fb3
to
4abf7d3
Compare
I'll have to complete this issue with benchmark data, and I want to slip this into I'll mention it only on the The Immortal Lock Slipseer thread for those who want to see some boost. This monster level is so far the only case |
Alea jacta est. |
This fix has significantly improved the performance of The Immortal map for my system (Intel Core i9-9880H @ 2.30 GHz CPU): I can now get 60 fps mot of the time. Here's a link to discussion regarding |
After various testing left and right, didn't saw any drawback so activate it by default Initially added in ##731
On my machine :
This significantly boost the perf in case there is a ton of edicts and ton of MOVETYPE_PUSH pushers
Found with The Immortal Lock
at this place in particular for comparison : s17_immortal_lock.zip
The change consist in pre-computing the list of 'pushable' entities once per
SV_Physics()
on whichSV_PushMove()
will iterate.By comparison, the original code iterate all
qcvm->num_edicts
at eachSV_PushMove()
.Turns out this simple change has a great impact on the fps in my case, just by shortenning the iteration or maybe by prefetching entities, because otherwise
SV_PushMove()
completly bottlenecks the rendering part, especially whenhost_maxfps 0
.Main settings :
vsync off
r_novis 0
: This is the default, but it does have a very positive impact here. I never played a level before this one wherer_novis 0/1
made the slightest difference. Not this time, though.This shows the
Min-Max
FPS you can get depending where you look in the scene:sv_fastpushmove 0
(default)sv_fastpushmove 1
cb1ebef
host_maxfps 58
host_maxfps 0
Another example by @j4reporting:
Machine: Intel nuc11phki7 ( Intel i7-1165g7 @2.80Ghz + Nvidia 2600 RTX mobile )
Resolution : 2560 x 1440
Display: 2560x1440 @144hz
Main setting :
host_maxfps 0
sv_fastpushmove 0
(default)sv_fastpushmove 1
Now, this change is not a benign one... It assumes the list of MOVETYPE_PUSH pushers and pushable entities is frozen within a single frame, that is if
PR_ExecuteProgram
has side-effects and changes themovetype
or even allocates / free eddicts, it is going to be taken into account the next frame only.I'm oppening this to share ideas, opinions, and (God forbid) bug reports.
This optimization, if valid, could be also applied for @sezero QS and @andrei-drexler Ironwail.