Boost logo

Boost Users :

From: Sohail Somani (s.somani_at_[hidden])
Date: 2007-04-25 14:50:30


> -----Original Message-----
> From: boost-users-bounces_at_[hidden]
> [mailto:boost-users-bounces_at_[hidden]] On Behalf Of
> Michael Marcin
> Sent: Wednesday, April 25, 2007 11:33 AM
> To: boost-users_at_[hidden]
> Subject: [Boost-users] [scoped_array] "optimization"
>
> Hello,
>
> I have a new programmer on my team who has been brought on as an
> optimization engineer. She has a lot more experience than I
> do but I fear
> some of that experience may have left impressions that have
> stuck with her
> for too long. On the first check in labeled spot
> optimizations there were
> many things changed that disturbed me. One of them was
> changing a class
> from essentially.

Besides the things you mention (the code being plain wrong!), I can't
imagine there is any optimization going on here. The only optimizations
worth doing are ones you can measure. Anything else is just guessing.

That being said, you should ask why she felt that was an optimization.
It could be at one point delete[] did something really stupid for
primitive types for some compiler but delete still deallocated the
memory. Who knows. The dark corners of our experiences we'd rather
forget still make us who we are :-) Make sure she knows the difference
between delete and delete[]. Anyway, none of this should be true for a
modern compiler. Make sure she knows that too!

Sohail


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net