why is there so much overhead with procedure calls is there something that pb does that just kills speed?
Procedure calls are speedy by them selfs but add them up in a for/while loop and they bring your program to a halt...
Procedure Overhead
Procedure Overhead
~Dreglor
Re: Procedure Overhead
Could you please explain what you mean by "overhead" and "brings program to halt" ?
compiles to
Can't see much overhead there.
Do you have any specific examples in which ASM generation fails or something?
Code: Select all
Procedure doSomething(var.l)
ProcedureReturn var.l*2
EndProcedure
For i=0 To 99
doSomething(i)
Next
Code: Select all
_Procedure0:
PUSH ebx
MOV ebx,dword [esp+8]
ADD ebx,ebx
MOV eax,ebx
JMP _EndProcedure1
XOR eax,eax
_EndProcedure1:
POP ebx
RET 4
MOV dword [v_i],0
_For1:
MOV eax,99
CMP eax,dword [v_i]
JL _Next2
PUSH dword [v_i]
CALL _Procedure0
_NextContinue2:
INC dword [v_i]
JMP _For1
_Next2:
Do you have any specific examples in which ASM generation fails or something?
Good programmers don't comment their code. It was hard to write, should be hard to read.


