Re: Exiting from a Do Loop
- From: David Kerber <ns_dkerber@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 11 May 2007 09:32:53 -0400
In article <QICdnZgTcIV3bt7bnZ2dnUVZ_vGinZ2d@xxxxxxxxxxx>,
mynamehere@xxxxxxxxxxx says...
"MikeD" <nobody@xxxxxxxxxxx> wrote in message
news:efBBvpykHHA.4112@xxxxxxxxxxxxxxxxxxxxxxx
For just ONE reason why GoSub is bad, see the following:
PRB: Poor Performance with the GoSub Statement
http://support.microsoft.com/kb/174808/en-us
Did anyone notice that the code at that link does not do test what it claims to
test? In particular, the function call version does not put the loop body in a
function, it just puts the whole loop in one, and should be identical to the
inline version.
I did a real test, and found that GoSub is faster than a Sub call if compiled to
PCode, and slower by quite a bit if compiled to native. In fact, compiled to
native it is slower than itself in pcode.
Why wouldn't an "optimizing" compiler simply inline all the GoSub code where
ever it was called?
Are you optimizing for speed or program size? That would change things
quite a bit in this case.
--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
.
- Follow-Ups:
- Re: Exiting from a Do Loop
- From: Steve Gerrard
- Re: Exiting from a Do Loop
- References:
- Exiting from a Do Loop
- From: Les
- Re: Exiting from a Do Loop
- From: Jeff Johnson
- Re: Exiting from a Do Loop
- From: MikeD
- Re: Exiting from a Do Loop
- From: Steve Gerrard
- Exiting from a Do Loop
- Prev by Date: Re: !!
- Next by Date: Re: The GradientFill, too Linear
- Previous by thread: Re: Exiting from a Do Loop
- Next by thread: Re: Exiting from a Do Loop
- Index(es):
Relevant Pages
|