Re: [fpc-pascal] Optimize code for speed

2005-06-13 Thread Gerhard Scholz
al Message - From: "Gerhard Scholz" <[EMAIL PROTECTED]> To: "FPC-Pascal users discussions" Sent: Friday, June 10, 2005 12:46 PM Subject: Re: [fpc-pascal] Optimize code for speed > - Original Message - > From: "L505" <[EMAIL PROTECTED]> >

Re: [fpc-pascal] Optimize code for speed

2005-06-10 Thread Gerhard Scholz
- Original Message - From: "L505" <[EMAIL PROTECTED]> To: "FPC-Pascal users discussions" Sent: Friday, June 10, 2005 10:18 AM Subject: [fpc-pascal] Optimize code for speed ... > 1. begin >M yString=Do.Something >StrLi

Re: [fpc-pascal] Optimize code for speed

2005-06-10 Thread Moz
L505 said: > What is more optimized code? The answer is "whatever your profiler says". Modern CPUs do so much faffing with what the compiler gives them that the only way to really know is to try it. Or if you're targetting specific (normally embedded) hardware, look at the assembly language and wo

[fpc-pascal] Optimize code for speed

2005-06-10 Thread L505
What is more optimized code? The problem is.. number 1 is easier to comment the source code. Number 2 doesn't waste an extra variable (would it be a pointer? or a copy of the var? if a pointer, any performance loss..or a very small one?) 1. begin MyString:= Do.Something(somestring);