On Mon, Apr 20, 2009 at 8:58 PM, Christopher Coale <[email protected]> wrote: > its going to be a lot faster to work > with pointers than to copy around data for every little thing you do.
Or there's references. Or there's the fact that it /may/ make little difference to the speed of the code if it's dealing with pointers to objects, references to objects or the objects themselves. If you're dealing with creating/deleting objects in the innermost loop that's running for 99% of the time when your application is running for days, it will make a substantial difference. If, on the other hand, it's maybe a one off occurrence, or something that might happen 0.1% of the time in your code (when most of the other 99.9% is waiting for user input or disk I/O) then it really doesn't matter. Which goes back to my first question - On Mon, Apr 20, 2009 at 4:23 PM, Paul Herring <[email protected]> wrote: > On Mon, Apr 20, 2009 at 4:18 PM, Jos Timanta Tarigan > <[email protected]> wrote: >> is there any point of creating a vector of pointer for efficiency stuuff? > > Do you have an efficiency problem? Guestimating where bottlenecks exist is not a productive use of any programmer's time - that's why profilers exist. And that's exactly what the rest of you are doing - guestimating. None of you have any idea what the OP's program does, nor where it spends most of its time - and I suspect the OP doesn't either; hence my question. -- PJH http://shabbleland.myminicity.com/ind http://www.chavgangs.com/register.php?referer=9375
