> On Sep 12, 2017, at 12:56 PM, Sven Barth via fpc-pascal 
> <fpc-pascal@lists.freepascal.org> wrote:
> 
> The Inc-/DecLocked routines perform a locked increment/decrement, so they're 
> blocking the memory bus for all cores (simply spoken), thus leading to a 
> higher CPU utilization. On e.g. i386 there is an optimisation to only do that 
> locking if IsMultiThread is True (some other platforms might benefit from 
> that optimization as well :/ ).
> Additionally they are the leave routines of the dynamic array management 
> code, so the time would be really used up there if not for the locking.

That’s probably it then even though I wasn’t growing the arrays by single 
elements (ReAllocMem didn’t give me problems). De facto Solution is to be safe 
and not use dynamic arrays in low-level high performance code.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to