Le 23.10.2013 14:22, Joel Rees a écrit :
On Wed, Oct 23, 2013 at 9:47 AM, <berenger.mo...@neutralite.org> wrote:


Le 22.10.2013 23:01, Jerry Stuckle a écrit :

On 10/21/2013 5:26 PM, berenger.mo...@neutralite.org wrote:

Le 18.10.2013 19:36, Jerry Stuckle a écrit :
[...]
Even inlined code requires resources to execute. It is NOT as fast
as regular C pointers.


I did some testing, to be sure. With -O3, the code is exactly the same. Did not tried with -O1 and -O2. Without optimization, the 5 lines with pointers were half sized of those using unique_ptr. But I never ship softwares not optimized (the level depends on my needs, and usually I do
not use -O3, though).


First of all, with the -O1 and -O2 optimization you got extra code.


Did you try it? It just did, with a code doing simply a new and a delete
with raw against unique_ptr. In short, the simplest usage possible.
Numbers are optimization level, p means pointer and u means unique_ptr.
It seems that it is the 2nd level of optimization which removes the
difference.

 7244 oct.  23 01:57 p0.out
 6845 oct.  23 01:58 p1.out
 6845 oct.  23 01:58 p2.out
 6845 oct.  23 01:58 p3.out

11690 oct.  23 01:59 u0.out
10343 oct.  23 01:59 u1.out
 6845 oct.  23 01:59 u2.out
 6845 oct.  23 01:59 u3.out

Just out of curiosity, how does the assembler output compare?

I did some diff on same size files, there was no difference.


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/7bf2f092ebf57277670a6f33dbafb...@neutralite.org

Reply via email to