We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

check performance limitations

Home Forums Puzzles check performance limitations

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #54346
    NaxosCG
    Customer

    Hello,

    I am testing the small script for enabling SSAA
    ( thanks @kvd77kvd : )

    After some tests, on my rtx3090, even 16x is fast, of course on a small radeon embedded into ryzen 5 4500u, fps are down, a lot (from 30fps to 17 with SSAA 4x). My tests are on the “spinner” demo scene.

    So i thought to use the puzzle “Check performances”, but even this small ryzen is found as a “good” gpu, so i guess the “good / poor” performance test is quite low.
    That would be great to have more differents results : poor, medium, good and extra (like in video games), so we could set more optimum parameters.

    Any idea ? Maybe with some scripting ?

    Regards.

    "1+1=3... for large values of 1"

    #54347
    xeon
    Customer

    I personally have found the good / poor performance indicator not a valuable indicator of any expected performance. I have many cards that report poor but perform better than those that report good. So not sure if it’s really an indicator of overall performance or just one stat but we just ignore that completely.

    We just conduct actual tests against required hardware and validate and call it a day.

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #54348
    kdv
    Participant

    check FPS and lower SSAA level after the app was loaded… you can calculate FPS using app.frame and Date.now()

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #54349
    kdv
    Participant

    Something like that. The code will stop checking the framerate in two cases: SSAA is disabled or the framerate is more than the desired minimal value.

    let sampleLevel = 4; //SSAA is set to 16x by default
    
    function checkFPS() {
        setTimeout(function() {
            const startFrame = app.frame;
            const startTime = Date.now();
            setTimeout(function() {
                const currFrame = app.frame;
                const currTime = Date.now();
                const fps = ((currFrame-startFrame)/(currTime-startTime))*1000;
                if (fps < 50) { //minimal desired framerate
                    if (sampleLevel > 0) { //if SSAA disabled do nothing
                        sampleLevel = sampleLevel - 1;
                        app.enableSSAA(sampleLevel, (sampleLevel == 0));
                        checkFPS();
                        console.log(sampleLevel);
                    }
                }
            }, 500); //measure interval, ms
        }, 500); //timeout after SSAA level change, ms
    }
    
    app.enableSSAA(sampleLevel, false);
    checkFPS();

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #54384
    NaxosCG
    Customer

    Many thanks ! It works well, i could change some values et see that on a small laptop, SSAA goes from 4 to 3, then 2, then 1 and stays at 1

    Of course, it would be great to be able to go back up in SSAA if we change zoom, content, etc…

    I guess it is not thinkable to test all the time (each frame / each 10sec). I don’t know how heavy it is to check and change, don’t know if this script would work continuously.

    "1+1=3... for large values of 1"

    #54388
    kdv
    Participant

    Of course, it would be great to be able to go back up in SSAA if we change zoom, content, etc

    What’s the problem? Run this script again after appending another scene…

    each frame / each 10sec

    don’t use this puzzles ))) you can’t stop them. use the timer puzzle instead. a timer can be stopped…

    I don’t know how heavy it is to check and change

    The script checks FPS no more than 4 times. Then it stops. CPU load is minimal…

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #54391
    kdv
    Participant

    don’t know if this script would work continuously.

    Well, this script checks fps continuously and changes SSAA level if needed B-) CPU load is minimal. But I wouldn’t recommend to use it )))

    let startFrame, startTime, currFrame, currTime, fps;
    let pageOnFocus = true;
    let sampleLevel = 4; //SSAA is set to 16x by default
    
    window.onfocus = function() {
        pageOnFocus = true;
    }
    
    window.onblur = function() {
        pageOnFocus = false;
    }
    
    function checkFPS() {
        setTimeout(function() {
            startFrame = app.frame;
            startTime = Date.now();
            setTimeout(function() {
                if (pageOnFocus) {
                    currFrame = app.frame;
                    currTime = Date.now();
                    fps = ((currFrame-startFrame)/(currTime-startTime))*1000;
                    if ((fps < 40) && (sampleLevel > 0)) { //min desired fps
                        sampleLevel = sampleLevel - 1;
                        app.enableSSAA(sampleLevel, (sampleLevel == 0));
                    } else if ((fps > 61) && (sampleLevel < 4)) { //max desired fps
                        sampleLevel = sampleLevel + 1;
                        app.enableSSAA(sampleLevel, false);
                    }
                }
                checkFPS();
                console.log(sampleLevel);
            }, 500); //measure interval, ms
        }, 500); //timeout after SSAA level change, ms
    }
    
    app.enableSSAA(sampleLevel, false);
    checkFPS();

    p.s. The first script has been updated to be more correct…

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #54394
    NaxosCG
    Customer

    Genious !

    "1+1=3... for large values of 1"

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.