English
Forum

Performancetricks

 
sometimes teste I with of/ one einfachen method The performance verschiedener Operationen.

I poste simply times the Resultate of my last Tests.

The number behind the Rem zeig The Number of Durchgänge within 3 sec, means so higher so faster.

The Tests show really what probably eh famous is: So less Lines, so faster. add could I: the einzeilige if counts hierbei as an eigenständige row, The function ABS against is faster. sure lying the too on it that the einzeilige if More To do has - what but too means that the einzeilige if not suitable is around the performance To raise.
CompileMarkSeparation
 {$cleq}
float ball.xs,ball.ys,ball.rs
cls
long tme=gettickcount+3000,c

while gettickcount<tme{

    c++
    perfProc()

}

print c
waitinput
end

perfProc{

    ball.xs=rnd(40)-20
    ball.ys=rnd(40)-20
    ball.rs=rnd(40)-20
    /* 34500
    case ball.xs>10		: ball.xs=10
    case ball.xs<-10 	: ball.xs=-10
    case ball.rs>10		: ball.rs=10
    case ball.rs<-10	: ball.rs=-10
    case ball.ys<-10 	: ball.ys=-10
    case ball.ys>10 	: ball.ys=10
    */
    /* 41000
    case abs(ball.xs)>10 : ball.xs=if(ball.xs<0,-10,10)
    case abs(ball.ys)>10 : ball.ys=if(ball.ys<0,-10,10)
    case abs(ball.ys)>10 : ball.ys=if(ball.ys<0,-10,10)
    */
    /* 24000
    ball.xs=if(ball.xs<-10,-10,if(ball.xs>10,10,ball.xs))
    ball.ys=if(ball.ys<-10,-10,if(ball.ys>10,10,ball.ys))
    ball.rs=if(ball.rs<-10,-10,if(ball.rs>10,10,ball.rs))
    */
    /*
    if abs(ball.xs)>10 {
    if ball.xs<0 {
    ball.xs=-10
    } else {
    ball.xs=10
    }
    }
    if abs(ball.ys)>10 {
    if ball.ys<0 {
    ball.ys=-10
    } else {
    ball.ys=10
    }
    }
    if abs(ball.rs)>10 {
    if ball.rs<0 {
    ball.rs=-10
    } else {
    ball.rs=10
    }
    }/span>
    */

}

 
11/05/07  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

558 Views

Untitledvor 0 min.
Sven Bader08/17/21
Peter Max Müller11/13/17
iF02/26/15

Themeninformationen

this Topic has 1 subscriber:

iF (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie