|
Boost : |
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2007-10-31 18:41:57
Avi Revivo <revivoavi <at> hotmail.com> writes:
[...]
> After dissecting i found out that the only problem is the the actual
> invocation of delete().
>
> Code executed:
> **********************************************************
>
> int *arrayOfPointers[100000];
>
> for(int i = 0; i < 100000; i++)
> {
> arrayOfPointers[i] = new int;
> }
>
> for(int i = 0; i < 100000; i++)
> {
> delete arrayOfPointers[i];
> }
>
> **********************************************************
>
> Excuting the for loop that deletes takes 25 times slower then any other
> computer tested. The average time for a single delete operation is longer in
> by factor of 25.
Umm... Still it looks like a cache issue. Can you try doing the
deleteion in reverse order, from 99999 down to 0? Any difference,
JoaquÃn M López Muñoz
Telefónica, Investigación y Desarrollo
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk