Code Monkey home page Code Monkey logo

Comments (8)

Xottab-DUTY avatar Xottab-DUTY commented on May 12, 2024

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?

from xray-16.

ViHtarb avatar ViHtarb commented on May 12, 2024

@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

from xray-16.

ViHtarb avatar ViHtarb commented on May 12, 2024

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

from xray-16.

Xottab-DUTY avatar Xottab-DUTY commented on May 12, 2024

@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;

from xray-16.

revolucas avatar revolucas commented on May 12, 2024

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.

from xray-16.

Xottab-DUTY avatar Xottab-DUTY commented on May 12, 2024

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)

from xray-16.

revolucas avatar revolucas commented on May 12, 2024

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.

from xray-16.

Xottab-DUTY avatar Xottab-DUTY commented on May 12, 2024

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))

from xray-16.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.