[OT -- not fpc-related -- just a side note]
On Fri, 7 May 2010 00:34:11 +0200
Jonas Maebe jonas.ma...@elis.ugent.be wrote:
in general my bias would be much more against than in favour of global
variables from a speed perspective
In _some_ dynamic languages using a virtual machine at least
If I remember this correctly, I've formerly ever read somewhere (in my Delphi
days) that array should be declared globally (not inside a function or
procedure) so that access to the array will be faster. Is this correct? If yes,
does this also true in FPC?
Thanks in advance.
On 06 May 2010, at 16:43, Bihar Anwar wrote:
If I remember this correctly, I've formerly ever read somewhere (in
my Delphi days) that array should be declared globally (not inside a
function or procedure) so that access to the array will be faster.
Is this correct?
No.
Jonas
Jonas Maebe wrote:
On 06 May 2010, at 16:43, Bihar Anwar wrote:
If I remember this correctly, I've formerly ever read somewhere (in
my Delphi days) that array should be declared globally (not inside a
function or procedure) so that access to the array will be faster. Is
this correct?
No.
Hello FPC-Pascal,
Thursday, May 6, 2010, 7:12:46 PM, you wrote:
If I remember this correctly, I've formerly ever read somewhere (in
my Delphi days) that array should be declared globally (not inside a
function or procedure) so that access to the array will be faster. Is
this correct?
No.
On 06 May 2010, at 18:12, Werner Van Belle wrote:
Jonas Maebe wrote:
On 06 May 2010, at 16:43, Bihar Anwar wrote:
If I remember this correctly, I've formerly ever read somewhere (in
my Delphi days) that array should be declared globally (not inside a
function or procedure) so that
Jonas Maebe wrote:
I don't have the faintest idea why it would be true.
I'll explain below
Local variables (including arrays) are allocated on the stack and are
accessed without any kind of indirection (except for dynamic arrays, but the
same goes for globally defined dynamic arrays).
This
On 06 May 2010, at 23:28, Werner Van Belle wrote:
In 'human' (haha) terms:
- global variable access: write data into 'ds+constant'
- local variables: write data into 'ss+bp+constant'.
Since the latter involves a term more I assume it is bound to take more
time.
That was true in the
On Thu, May 6, 2010 at 7:34 PM, Jonas Maebe jonas.ma...@elis.ugent.be wrote:
On 06 May 2010, at 23:28, Werner Van Belle wrote:
In 'human' (haha) terms:
- global variable access: write data into 'ds+constant'
- local variables: write data into 'ss+bp+constant'.
Since the latter involves a
Thanks Jose, Werner, and Jonas for the fantastic discussion and explanation.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
10 matches
Mail list logo