| |
|
|
| i see something not! my Performancevergleich between Between and of/ one own function has yield the The Own function explicit faster operates.
I have Perhaps but too wrong tested! here my Test for Between (becomes by me 18.000 time worn out) CompileMarkSeparationvar BALL.XS!=0
var BALL.YS!=0
var BALL.RS!=0
CLS
var TME&=&GETTICKCOUNT+3000
var C&=0
WHILE &GETTICKCOUNT<TME&
C&=C&+1
PERFPROC()
ENDWHILE
PRINT C&
WAITINPUT
END
proc PERFPROC
BALL.XS!=RND(40)-20
BALL.YS!=RND(40)-20
RETURN RECTINTERSECT(BALL.XS!,BALL.YS!,100,100,50,50,200,200)
endproc
proc RECTINTERSECT
PARAMETERS X!,Y!,XX!,YY!,XXX!,YYY!,XXXX!,YYYY!
RETURN BETWEEN(X!,XXX!,XXXX!,Y!,XXX!,YYYY!) OR BETWEEN(XX!,XXX!,XXXX!,YY!,XXX!,YYYY!)
endproc
and here The faster Own Version (becomes by me 21.000 time worn out) CompileMarkSeparationvar BALL.XS!=0
var BALL.YS!=0
var BALL.RS!=0
CLS
var TME&=&GETTICKCOUNT+3000
var C&=0
WHILE &GETTICKCOUNT<TME&
C&=C&+1
PERFPROC()
ENDWHILE
PRINT C&
WAITINPUT
END
proc PERFPROC
BALL.XS!=RND(40)-20
BALL.YS!=RND(40)-20
RETURN RECTINTERSECT(BALL.XS!,BALL.YS!,100,100,50,50,200,200)
endproc
proc RECTINTERSECT
PARAMETERS X!,Y!,XX!,YY!,XXX!,YYY!,XXXX!,YYYY!
IF (XX!<XXX!) OR (X!>XXXX!)
RETURN 0
ENDIF
IF (YY!<YYY!) OR (Y!>YYYY!)
RETURN 0
ENDIF
RETURN 1
endproc
The faster Version has More XProfanzeilen, I had meant the Between in the or-Doppelpack nevertheless faster is. |
|
|
| |
|
|
|
| I see strain the CompileMarkSeparation
proc RECTINTERSECT
PARAMETERS X!,Y!,XX!,YY!,XXX!,YYY!,XXXX!,YYYY!
RETURN BETWEEN(X!,XXX!,XXXX!,Y!,XXX!,YYYY!) OR BETWEEN(XX!,XXX!,XXXX!,YY!,XXX!,YYYY!)
endpr
anyhow wrong is, but the ought to in the reference on the Geschwindigkeitstest none Einfluss having. |
|
|
| |
|
|
|
RGH | try it with the new function INTERSECT(): CompileMarkSeparation The letzer procedure is only because of the Vergleichbarkeit there. naturally would mach on these dispense and supra same INTERSECT(s, BALL#, TEST#) write, what The story again circa over 40% speed. Greeting Roland |
|
|
| Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 11/24/07 ▲ |
|
|
|
|
RGH | |
|
| Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 11/24/07 ▲ |
|
|
|
|
RGH | iF
i see something not! my Performancevergleich between Between and of/ one own function has yield the The Own function explicit faster operates. The faster Version has More XProfanzeilen, I had meant the Between in the or-Doppelpack nevertheless faster is.
Hello iF,
what XProfan-intern a good deal Time uses, is the evaluate of Parameters, alike whether as Funktionsparameter in clinging or as procedure-Parameter with PARAMETERS. In Your example with BETWEEN there of it a stattliche amount More, as in the without (20 here and 8 there). The benefit of BETWEEN is here the, that You really no Own Proztedur RECTINTERSECT More need and the Einzeiler directly bring into action can. already reduce the übergebenen Parameter of 20 on 12 ... and already is the whole twice so quick (though it still 4 Parameterübergaben More are): CompileMarkSeparationvar BALL.XS!=0
var BALL.YS!=0
CLS
var TME&=&GETTICKCOUNT+3000
var C&=0
WHILE &GETTICKCOUNT<TME&
C&=C&+1
PERFPROC()
ENDWHILE
PRINT C&
WAITINPUT
END
proc PERFPROC
BALL.XS!=RND(40)-20
BALL.YS!=RND(40)-20
RETURN BETWEEN(BALL.XS!,50,200,BALL.YS!,50,200) OR
BETWEEN(100,50,200,100,50,200)
endproc
Greeting Roland |
|
|
| Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 11/24/07 ▲ |
|
|
|