[fpc-devel] static vs dynamic arrays

Пётр Косаревский ppkk at mail.ru
Tue Apr 4 17:12:33 CEST 2006


> > Because of the copy-on-write mechanism.
> 
> No, that is not true. He's now using plain pointers. The compiler  
> does not keep track of the fact that a particular pointer points to a  
> reference-counted type. Both loops are now equally fast in principle  
> (and they are in practice on e.g. ppc).
> 
> The only "problem" is that c and c1 are also assigned registers, and  
> become in use after the first loop. Because of this, bp and bpp can't  
> be assigned a register anymore on x86 and are kept in memory instead  
> of in a register. The register allocator puts registers with most  
> conflicts in memory first, and these variables apparently have more  
> conflicts than c/c1.

If he understands right: if he reverted the order of the "loops" (big loops, each between time measurings) or separated "loops", splitting program, he'd get different results.
However, splitting tests or reverting order doesn't seem to change timings.



More information about the fpc-devel mailing list