| |
|
|
- Page 1 - |
|
| The first Collisionsabfrage with the Viereck 128X128 Pixel. I form the Viereck now Black ex, so möglichs many colours taken go can. there otherwise others colours in the Viereck also The Collisionsfarbe having ,addressed go. If the car the "Viereck" touched ,which herewith prepares watts : ogl("glReadPixels",140,140,128,128,~GL_BGRA,~GL_UNSIGNED_BYTE,ogl_rgb#) , becomes the worth 255 spend.
Massgebend are The colours RGB greater 252. Can anytime in the CPP-File Change.
have first once The request with the DEV C++ made or DLL prepares., because I in ASM first again failed be. The DEV C++ Source-Files are too with thereby.
The zipper is appended.
mfg |
|
|
| |
|
|
|
| |
|
- Page 1 - |
|
| Ablaufzeiten (gross)the Collisionsabfrage the Rechteckes 128X128X4 with 10000 Schleifendurchgänge : computer with 1,6 Gigahz
The Profan While-Leerschleife need ca 200ms.
ASM with XPIA/XPSE (DLL) are it 4550 ms .
DEV C++ are it 6210 ms ( a For-Loop).
DEV C++ are it 6260 ms (While-Loop).
with 10000 durchgängen rewards it itself this in ASM umzusetzen, are ca 1,5 sec Difference.
mfg peter |
|
|
| |
|
|
|
Frank Abbing | your Assembler-routine isn't optimiert. If you tappt im dunkeln umstellst of variables on tab is yet some More drin. ca. 20 percent, wealth I.
These routine keeps your Programmstruktur with, ought to but already work faster: CompileMarkSeparation
If 0
AsmStart rgb_farbe (ogl_rgbxy#,groesse%)
mov edi,para2
xor ecx,ecx
mov ebx,para1
.while ecx<=edi
mov al,[ebx]
mov cl,[ebx+1]
mov dl,[ebx+2]
.if al>252
mov eax,255
.break
.endif
.if cl>252
mov eax,255
.break
.endif
.if dl>252
mov eax,255
.break
.endif
lea ebx,[ebx+4]
lea ecx,[ecx+4]
.endw
AsmEnd(z%)
EndIf
|
|
|
| |
|
|
|
Jörg Sellmeyer |
The Profan While-Loop need ca 200ms.
are You sure, that Profan More as 20-time faster is as ASM? |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 08/22/08 ▲ |
|
|
|
|
| should Empty-Loop heissen, because I integrally supra too of gross promise. The Test runs with all in the same While-Loop of Profan
I have too time this Freebasic tested to that DLL create.
who in Freebasic a DLL create would like and no ASM can/would like and no "C", is so well bedient.
The Freebasic-DLL need 7400ms means only 1 second longer as DEV C++.
might for Basicprogrammierer , a DLL create would of/ one the best Freewarealternativen his.
with of my Collisionstest-Auswertung with the Freebasic-DLL on-screen on the graphic, is me the Difference optisch not noticed. the Objekt flitzte furthermore still hither and thither withal the Überprüfung/Auswertung.
mfg peter |
|
|
| |
|
|
|
| Frank, your need 3,5 sec longer.
I knows now not, How with the whom Registern and LEA there functions. On each drop must The address always circa "4" go on.
mfg peter |
|
|
| |
|
|
|
Frank Abbing |
Frank, your need 3,5 sec longer.
incorrect! tab works always faster as Varablen in memory, even if tappt im dunkeln pub are. such Tests have I already dozens implemented. And so a Assemblerroutine needed never 3,5 sec longer, tappt im dunkeln needed at all only few Millisekunden altogether. even if You with grossen Bitmaps work. You can the gladly with the ProSpeed.dll testing, The numerous Bitmapeffekte knows. Irgendwas goes with your Tests vast schief. What exactly should The routine because make? tappt im dunkeln fractures still immediate ex, as they a very hellen Farbwert finds. If you a Robotersoftware write want, The The data of/ one Cam auswertet, must You already The amount heller Bildpunkte count. before but the Cambild gray make, or. Black-knows. |
|
|
| |
|
|
| |
|
- Page 2 - |
|
|
| yet be I do not at Roboterbild, the has yet time. i want first once The fastest routines find for Bildauswertung in the zusammenhang with OpenGL and its statement. Befinde me still in the Anfangsstufe because I the Profan first to 3 weeks gotten to know have. there the ASM with moreover comes has the Lernumfang changed. and have on the side already nice erkenntnisse with Getdibits , Setdibits etc assembled.
here the code for terms testing : CompileMarkSeparationDEF rgb_farbe_asm(2) ! "ogl-asm-test.dll","rgb_farbe"
DEF rgb_farbe_asm_o(2) ! "ogl-asm-test.dll","rgb_farbe_o"
declare bildxy# ,ogl_rgb#,x&,y&,z%
var groesse%=128*128*4
dim bildxy#,groesse%,z%
dim ogl_rgb#,groesse%
x&=10000
Print "Bereich mit 0 füllen"
whileloop 0,groesse%-1
byte ogl_rgb#,&loop=0
endwhile
Print "rgb_farbe-asm"
y&=&GetTickCount
Whileloop x&
z%=rgb_farbe_asm(ogl_rgb#,groesse%)
EndWhile
y&=&GetTickCount-y&
Print "Fertig in "+Str$(y&)+" Millisekunden."
Print "while-schleife"
y&=&GetTickCount
Whileloop x&
EndWhile
y&=&GetTickCount-y&
Print "Fertig in "+Str$(y&)+" Millisekunden."
Print "rgb_farbe-asm_o"
y&=&GetTickCount
Whileloop x&
z%=rgb_farbe_asm_o(ogl_rgb#,groesse%)
EndWhile
y&=&GetTickCount-y&
Print "Fertig in "+Str$(y&)+" Millisekunden."
WaitInput
End
and here the ASM-code , woraus I a DLL prepares with XPIA/XPSE CompileMarkSeparation
AsmStart rgb_farbe_o (ogl_rgbxy#,groesse%)
mov edi,para2
xor ecx,ecx
mov ebx,para1
.while ecx<=edi
mov al,[ebx]
mov cl,[ebx+1]
mov dl,[ebx+2]
.if al>252
mov eax,255
.break
.endif
.if cl>252
mov eax,255
.break
.endif
.if dl>252
mov eax,255
.break
.endif
lea ebx,[ebx+4]
lea ecx,[ecx+4]
.endw
AsmEnd(z%)
AsmStart rgb_farbe
Parameters ogl_rgbxy#,groesse%
LOCAL r :BYTE
LOCAL g :BYTE
LOCAL b :BYTE
LOCAL n :DWORD
mov eax,para2
mov n,eax
mov ecx,0
mov ebx,para1
.while ecx<=n
mov al,[ebx+ecx]
mov r,al
mov al,[ebx+ecx+1]
mov g,al
mov al,[ebx+ecx+2]
mov b,al
mov al,b
.if al>252
mov eax,255
.break
.endif
mov al,g
.if al>252
mov eax,255
.break
.endif
mov al,r
.if al>252
mov eax,255
.break
.endif
add ecx,4
.endw
AsmEnd(z%)
|
|
|
| |
|
|
|
Frank Abbing | Peter, You must y& to your first Zeitmessung again zurücksetzten...
Ausserdem misst You not The speed the Assemblerroutine, separate The duration one Dll-Call. where You The Dll not even into memory lädts.
my Messungen confirm my testimony of today afternoon. your routine needed for Loop 344 Millisekunden, if I these hundred millions(!) times through let. my routine needed for same Schleifenanzahl 172 Millisekunden. this is exakt twice so quick!
here The simple Testroutine, with the You anytime my code against your replace can to that testing: CompileMarkSeparation {$cleq}
declare ogl_rgb#,y&
var groesse%=100000000
dim ogl_rgb#,groesse%
cls
Sleep 3000
y&=&GetTickCount
AsmStart rgb_farbe (ogl_rgb#,groesse%)
mov edi,para2
xor ecx,ecx
mov ebx,para1
.while ecx<=edi
mov al,[ebx]
mov cl,[ebx+1]
mov dl,[ebx+2]
.if al>252
mov eax,255
.break
.endif
.if cl>252
mov eax,255
.break
.endif
.if dl>252
mov eax,255
.break
.endif
lea ebx,[ebx+4]
lea ecx,[ecx+4]
.endw
AsmEnd(z%)
Print Str$(Int(&GetTickCount-y&))
WaitInput
dispose ogl_rgb#
/../funcion-referencias/XProfan/end/'>End
| be in future vorsichtiger with your allegations. i want not, that of of my software and of Assembler at all one Wrong Image arise, only because You fehlerhafte testify verbreitest because of your fehlerhaften Testverfahren and Codes. | |
|
|
|
| |
|
|
|
| The 1. Time ca 4000ms
The 2. Time ca 200ms
The 3. Time ca 8000ms
this Testprogramm is from this Forum. one must always mißtrauischer go, traue keinem strangers Program. I have such a thing already geahnt.
I have me times the Taktcyklen herausgesucht and umgerechnet. I come almost on your Time. such a thing sharpens whom spirit, but nevertheless scheiss work.
power over ands over again joke.
this is program. high lebe The Own Überprüfung.
so now go to that next Topic....., it goes on Jungs and Mädels.
mfg |
|
|
| |
|
|
|
Frank Abbing | look you my code still on. You misst whom Dll-appeal, the has with Assemblergeschwindigkeit mere none To do.
what misstrauisch? XPIA is my Program. |
|
|
| |
|
|
|
| Frank you are super. too these runs with your Messung and your ASM-suggestion only concise 300ms. this is still what. super thing. there was the worm drin.
have it with of/ one FreeBasic-DLL tested, need 532ms. can means hochgerechnet ca per second 93 Images evaluate with 128*128*4 Pixel with a Framerate of 30 or can with 970ms ca 53 BMP-Textures reading. CompileMarkSeparationEXTERN "windows-ms"
FUNCTION rgb_farbe( adr AS ANY PTR ,ByVal wert As uinteger) AS INTEGER EXPORT
DIM i AS UInteger,n As UInteger
Dim b As Ubyte,g As Ubyte,r As UByte,a As UByte
FOR i = 0 TO wert Step 4
b=Peek(BYTE, adr+i )
g=Peek(Byte,adr+i+1)
r=Peek(Byte,adr+i+2)
If (b>252) Or (g>252) Or (r>252) Then
a=255
Exit for
EndIf
NEXT
Return a
END Function
function bmptex ( adr AS ANY PTR ,ByVal wert As uinteger) AS INTEGER EXPORT
DIM i AS UInteger,n As UInteger
Dim b As ubyte,g As ubyte,r As UByte
FOR i = 0 TO wert Step 4
b=Peek(BYTE, adr+i ) And 255
g=Peek(Byte,adr+i+1) And 255
r=Peek(Byte,adr+i+2) And 255
If (r=0) and (b=0) and (g=0) Then
Poke Byte,adr+i+3,0
Else
Poke Byte,adr+i+3,255
EndIf
Poke Byte,adr+i+2,b
Poke Byte,adr+i,r
NEXT
END function
END Extern
CompileMarkSeparation |
|
|
| |
|
|
|
| so, this issue is now first once through for my tack. in the attachment as zipper : an Collison with a Viereck. Objektsteuerung with the Keys : QWES. thereby The FreeBascic Bas, woraus I The beiliegende DLL prepares have with the Program FreeBasic. as nächstes comes evtl one unregelmäßiges Kollisionsobjekt.
Perhaps creates the too another Forum-User.
my Schwerpunkt remaining first once with 2D.
mfg peter |
|
|
| |
|
|