Skip to content
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

Fix bug with more load on process than it should be #24

Closed
ViHtarb opened this issue Jun 18, 2015 · 8 comments
Closed

Fix bug with more load on process than it should be #24

ViHtarb opened this issue Jun 18, 2015 · 8 comments
Labels
Bug The issue in the run-time. Renderer

Comments

@ViHtarb
Copy link

ViHtarb commented Jun 18, 2015

Plz fix a bug in xrRender/ParticleEffects.cpp in line 546 and xrParticles/particle_actions_collection.cpp in line 1779:
change from if (p_cnt < nWorkers * 20) on if (p_cnt < nWorkers * 64)

@ViHtarb ViHtarb changed the title Fix bug with high load on processor Fix bug with more load on process than it should be Jun 18, 2015
@nitrocaster nitrocaster added the Bug The issue in the run-time. label Nov 3, 2015
@Xottab-DUTY
Copy link
Member

The original code was

if (p_cnt < (nWorkers * 64))
    nWorkers = 1;

Currently, with that fix, code looks like this:

if (p_cnt < (nWorkers * 20))
    nWorkers = 1;

I found in r8384 (leaked COP svn revision ~March 2012) this code:

if (p_cnt < nWorkers)
   nWorkers = p_cnt;

Which code is better and what does it do?

@ViHtarb
Copy link
Author

ViHtarb commented Aug 11, 2017

@Xottab-DUTY
Hi. I don`t know but on my old computer with Core 2 Duo E7300 code "if (p_cnt < (nWorkers * 20))" provides 100% load and particles bugs(it`s look like rainbows instead anomalies) instead "if (p_cnt < (nWorkers * 64))"

Code "if (p_cnt < (nWorkers * 64))" i found in sources of release engine version of COP

Code "if (p_cnt < nWorkers) = p_cnt;" i did not see and don`t tried to use

@ViHtarb
Copy link
Author

ViHtarb commented Aug 11, 2017

Now i noticed that this change is not in the dev and another branches of project. But why?

@Xottab-DUTY
Copy link
Member

@nitrocaster fixed this.. Maybe this commit was occasionally dropped.
So, we need to find, what solution is better

if (p_cnt < (nWorkers * 64))
    nWorkers = 1;

or

if (p_cnt < nWorkers)
   nWorkers = p_cnt;

@revolucas
Copy link
Contributor

revolucas commented Aug 12, 2017

CPU usage is 90% on my 6-core with:

if (p_cnt < nWorkers)
nWorkers = p_cnt;


if (p_cnt < (nWorkers * 64))
nWorkers = 1;

Is how it is in Shadow of Chernobyl and Clear Sky source and does seem to run better then * 20. Only 20% CPU usage.

I downloaded CoP revision 8384. It seems to be much older then whatever Nitro used as the base for OpenXray.

@Xottab-DUTY
Copy link
Member

Xottab-DUTY commented Aug 12, 2017

Oh, thank you!
As far, as I know, nitrocaster used 1.6.0.2 and r8384 should be newer... Looks like I catch some bit of a nonsense here. =)
But whatever, * 64 seems to be a better solution.

P.S. by the way, @ViHtarb says that (nWorkers * 20) gives graphical bugs. @revolucas what about graphics look with if (p_cnt < nWorkers) nWorkers = p_cnt; variant? Just interesting)

@revolucas
Copy link
Contributor

I didn't notice any graphical differences, only lag when using if (p_cnt < nWorkers) nWorkers = p_cnt;

I don't know about r8384. It's strange as it has many slight differences, almost like it's sabotage to make it run as shitty as possible.

@Xottab-DUTY
Copy link
Member

In theory if (p_cnt < nWorkers) nWorkers = p_cnt; should increase performance because it creates more workers if there's many particles.. But workers themselves needed to be optimized to take effect of multiplying them... Well.. all the code needs optimizing I'd say))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug The issue in the run-time. Renderer
Projects
None yet
Development

No branches or pull requests

4 participants