Closed eezstreet closed 8 years ago
printf it to see how often it happens
I spammed echo before firing a shot to make it more clear what is going on. I fired a bryar bolt at a pretty close distance at a wall, and put a print statement on the SScheduledEffect constructor. Here's what I got: http://i.imgur.com/tgdiUoc.jpg
That's 11 memory allocations being done for one shot. That's ridiculous.
Potentially fixed in c986357 for JASP and 712627a for JK2SP
Please test both I checked JASP locally but JK2 hasn't been thoroughly tested.
@eezstreet close if confirmed fixed for you.
Couldn't find an open issue about the topic, but I'm pretty sure I've narrowed down the cause of why EFX is so slow on debug builds.
https://github.com/JACoders/OpenJK/blob/3918cd94301fdc3ea468d4e6474c9f27c72168d3/code/cgame/FxScheduler.cpp#L888
The FXScheduler will spam a new ScheduledEffect every frame (potentially) for every effect primitive that has a delay.