220 34895 <b50be367-9a0c-4d62-a392-d2b4471d7403@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: euloanty@live.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Thoughts on more methods towards containers in
 the future
Date: Sat, 14 Oct 2017 06:27:44 -0700 (PDT)
Lines: 126
Approved: news@gmane.org
Message-ID: <b50be367-9a0c-4d62-a392-d2b4471d7403@isocpp.org>
References: <973f04da-1354-44f4-9d1f-23f04596b8dc@isocpp.org>
 <20171014085305.GA24512@fukushima.lysator.liu.se>
 <79c51b8c-6cc2-4872-8651-9dae513d1e21@isocpp.org>
 <1550fc17-cf97-438d-9e7a-862f729adbf5@isocpp.org>
 <0cc942cf-a217-4175-98b0-b466ac224dc7@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2293_1746173585.1507987664129"
X-Trace: blaine.gmane.org 1507987678 11929 195.159.176.226 (14 Oct 2017 13:27:58 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 14 Oct 2017 13:27:58 +0000 (UTC)
Cc: euloanty@live.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDPYX6PYRQNBBUFBRDHQKGQEDUJCLQA@isocpp.org Sat Oct 14 15:27:54 2017
Return-path: <std-proposals+bncBDPYX6PYRQNBBUFBRDHQKGQEDUJCLQA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ua0-f199.google.com ([209.85.217.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDPYX6PYRQNBBUFBRDHQKGQEDUJCLQA@isocpp.org>)
	id 1e3MTf-0000Tb-K6
	for gclcip-std-proposals@m.gmane.org; Sat, 14 Oct 2017 15:27:43 +0200
Original-Received: by mail-ua0-f199.google.com with SMTP id 65sf902223uaq.4
        for <gclcip-std-proposals@m.gmane.org>; Sat, 14 Oct 2017 06:27:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=c/7l8yWIlYmMwz+LdcKhsBHxlHiAA1PZlKFTvo8miXU=;
        b=z7NT75ehhyT7Vmr/2e2OA2+t4xTELGfucVFUQz8aqxxaffdLMg+H4QpbWXckefdVlV
         H/fbY06v3qVId50N7wDsT580xP5J5WzQ7S8elp+wh22l0WF+ETZED2mVFkYV1gygFAMO
         3BoVF+/z/nJ7FvhItZb3Eq+LHjtVExnqCgYeqjzjfmv9lCqm4ye6IVVWxcRB+v4TKhas
         7CcpF758BwMuh9ImMaeMxWBXZrqvJGMW55fbCto4kHJjSuNHj5UcuTt43TigPZ7NGXrV
         aMEx/2YYe+FHXM0PzD2TcC3hOGQZUx3eUE3qmMjmysK6TcQH3SWQLRvI44je6hHM/0LB
         eJ8Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:x-original-sender:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=c/7l8yWIlYmMwz+LdcKhsBHxlHiAA1PZlKFTvo8miXU=;
        b=aewH2tOx03Pf/LBiSAxgUcaQt/CR8S6hnJSGz+Y7dHgtei1W9tqvvqoKs30oyO/J3y
         oETY+K1D6qfh1q1bGk9jtQLGzgWXimTIGerreY8l2Wy2ITd7kvqReO025jmVpQ3pX5PU
         07LVbxtMwuvFZRjNWEL/7Iq0HXBVznL8SECznCekYP5FCHT5IsF+JQLqDaOvP6YNDQEt
         ZdQC94chwYJ6K8VuoyESbzskdGaixgFC60eN+RIBMp7bCBsNrmvTJP+EwMU21DEWlZ61
         GZ65YPMrB8RCwdOpaAwJzZ1PDpiHz/N/9hhOO0qleUQdPht8HRb0SmFrOFRvgVacj8+g
         RQdA==
X-Gm-Message-State: AMCzsaV7MXmtmCUSL97Ryd28qMOcWJYJpHk+gyx6PGh1JeK9CS28AUuo
	P3vaF+gik357crpRsmK2svKRnA==
X-Google-Smtp-Source: AOwi7QBiCNzKDm1k/0gI4IL1y/KEBncEKwfXDtstWuIUSCy+QMml99ZD49Q9cqH7eZ42YKRf8Gmwgw==
X-Received: by 10.31.140.14 with SMTP id o14mr2277595vkd.102.1507987665687;
        Sat, 14 Oct 2017 06:27:45 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.176.91.4 with SMTP id u4ls2437911uae.4.gmail; Sat, 14 Oct 2017
 06:27:44 -0700 (PDT)
X-Received: by 10.31.96.146 with SMTP id u140mr289292vkb.2.1507987664612;
        Sat, 14 Oct 2017 06:27:44 -0700 (PDT)
In-Reply-To: <0cc942cf-a217-4175-98b0-b466ac224dc7@isocpp.org>
X-Original-Sender: euloanty@live.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:34895
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/34895>

------=_Part_2293_1746173585.1507987664129
Content-Type: multipart/alternative; 
	boundary="----=_Part_2294_1515811434.1507987664130"

------=_Part_2294_1515811434.1507987664130
Content-Type: text/plain; charset="UTF-8"

https://github.com/euloanty/cqwrteur-vector/blob/master/deque.cc

Try this code.

BTW. deque is "slower" than vector because of this dumb check if

On Saturday, October 14, 2017 at 9:24:37 AM UTC-4, eulo...@live.com wrote:

> O2 wont eliminate this cost. It is not optimization issue. I always use 
> -O2 to compile my programs
>
> On Saturday, October 14, 2017 at 9:18:56 AM UTC-4, Todd Fleming wrote:
>>
>> On Saturday, October 14, 2017 at 8:45:29 AM UTC-4, ejsvifq mabmip wrote:
>>>
>>> On Saturday, October 14, 2017 at 4:53:10 AM UTC-4, Magnus Fromreide 
>>> wrote:
>>>>
>>>> On Fri, Oct 13, 2017 at 07:38:20PM -0700, eulo...@live.com wrote: 
>>>> > Contiguous Containers: 
>>>> > 
>>>> > vector: 
>>>> > add non check push_back. non check resize etc. 
>>>>
>>>> What does this mean, you are a bit thin on details here. 
>>>>
>>>> ok. when you push_back an element into the vector, it will first check 
>>> whether size()==capacity(). It is an overhead when you know what exactly 
>>> the size of elements you need.
>>>
>>> For example:
>>>
>>> vector<std::size_t> v;
>>> v.reserve(10000000);
>>> for(std::size_t i(0);I!=v.capacity();++i)
>>>      v.emplace_back(i);
>>>
>>> will be slower than
>>>
>>> vector<std::size_t> v;
>>> v.reserve(10000000);
>>> for(std::size_t i(0);I!=v.capacity();++i)
>>>      v.nonchecked_emplace_back(i);
>>>
>>
>> Benchmark requested using -O2 or higher; I doubt your performance claim.
>>
>> Todd
>>
>>

-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/b50be367-9a0c-4d62-a392-d2b4471d7403%40isocpp.org.

------=_Part_2294_1515811434.1507987664130
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>https://github.com/euloanty/cqwrteur-vector/blob/mast=
er/deque.cc</div><div><br></div><div>Try this code.</div><div><br></div><di=
v>BTW. deque is &quot;slower&quot; than vector because of this dumb check i=
f<br><br>On Saturday, October 14, 2017 at 9:24:37 AM UTC-4, eulo...@live.co=
m wrote:</div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-l=
eft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"=
>O2 wont eliminate this cost. It is not optimization issue. I always use -O=
2 to compile my programs<br><br>On Saturday, October 14, 2017 at 9:18:56 AM=
 UTC-4, Todd Fleming wrote:<blockquote class=3D"gmail_quote" style=3D"margi=
n:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=
=3D"ltr">On Saturday, October 14, 2017 at 8:45:29 AM UTC-4, ejsvifq mabmip =
wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex=
;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">On Saturday,=
 October 14, 2017 at 4:53:10 AM UTC-4, Magnus Fromreide wrote:<blockquote c=
lass=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #c=
cc solid;padding-left:1ex">On Fri, Oct 13, 2017 at 07:38:20PM -0700, <a rel=
=3D"nofollow">eulo...@live.com</a> wrote:
<br>&gt; Contiguous Containers:
<br>&gt;=20
<br>&gt; vector:
<br>&gt; add non check push_back. non check resize etc.
<br>
<br>What does this mean, you are a bit thin on details here.
<br>
<br></blockquote><div>ok. when you push_back an element into the vector, it=
 will first check whether size()=3D=3Dcapacity(). It is an overhead when yo=
u know what exactly the size of elements you need.</div><div><br></div><div=
>For example:</div><div><br></div><div>vector&lt;std::size_t&gt; v;</div><d=
iv>v.reserve(10000000);<br></div><div>for(std::size_t i(0);I!=3Dv.capacity(=
);++i)</div><div>=C2=A0 =C2=A0=C2=A0 v.emplace_back(i);</div><div><br></div=
><div>will be slower than</div><div><br></div><div><div>vector&lt;std::size=
_t&gt; v;</div><div>v.reserve(10000000);<br></div></div><div><div>for(std::=
size_t i(0);I!=3Dv.capacity();++i)</div><div>=C2=A0 =C2=A0=C2=A0 v.noncheck=
ed_emplace_back(i);</div></div></div></blockquote><div><br></div><div>Bench=
mark requested using -O2 or higher; I doubt your performance claim.</div><d=
iv><br></div><div>Todd</div><div><br></div></div></blockquote></div></block=
quote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/b50be367-9a0c-4d62-a392-d2b4471d7403%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/b50be367-9a0c-4d62-a392-d2b4471d7403=
%40isocpp.org</a>.<br />

------=_Part_2294_1515811434.1507987664130--

------=_Part_2293_1746173585.1507987664129--

.
