Marcus Lindblom wrote:
> We used shared_ptr's in our dynamic matrix objects for our math library. 
> That was not really a good idea, as it showed up on benchmarks. An 
> intrusive solution worked better (the ptr-manip time became 
> insignificant). I'll try to dig up the performance benchmark I wrote a 
> year ago on that. (It's at work, so it'll have to wait til tomorrow).
>   
I've digged. And what I found doesn't match my memory:

Plain ptr copy ctor: 0.00203698
Shared array copy ctor: 0.157275
Intrusive ptr (RefObject) copy ctor: 0.0706685
Intrusive ptr (LWRefObject<T>) copy ctor: 0.00488339

(Shared_ptr/array is only twice as slow as my thread-safe intrusive ptr 
and ~30 times slower than a non-threadsafe intrusive ptr, and 80 times 
slower than plain ptrs).

Hm. Also, I couldn't find the test source (only the results). I did find 
a different test that indicates a similar data, but due to how I wrote 
it at that time, I do not have confidence it the results anymore. I'm 
deep down developing a trucky algorithm at the moment, so I couldn't 
summon enough spare brain cycles do a sufficiently quick fix either (I 
tried).

Nevertheless, the ability to pass plain c-ptrs around is extremely nice, 
performance issues nonwithstanding.

Cheers,
/Marcus

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to