220 34898 <e5065ef4-4802-4241-8357-cfb93ba25bae@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: inkwizytoryankes@gmail.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:49:13 -0700 (PDT)
Lines: 147
Approved: news@gmane.org
Message-ID: <e5065ef4-4802-4241-8357-cfb93ba25bae@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>
 <b50be367-9a0c-4d62-a392-d2b4471d7403@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1275_2037593031.1507988954008"
X-Trace: blaine.gmane.org 1507988959 14477 195.159.176.226 (14 Oct 2017 13:49:19 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 14 Oct 2017 13:49:19 +0000 (UTC)
Cc: euloanty@live.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDDLTAGNTIBBBWVLRDHQKGQEIKG4YBQ@isocpp.org Sat Oct 14 15:49:14 2017
Return-path: <std-proposals+bncBDDLTAGNTIBBBWVLRDHQKGQEIKG4YBQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vk0-f69.google.com ([209.85.213.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDDLTAGNTIBBBWVLRDHQKGQEIKG4YBQ@isocpp.org>)
	id 1e3MoO-0002c5-DQ
	for gclcip-std-proposals@m.gmane.org; Sat, 14 Oct 2017 15:49:08 +0200
Original-Received: by mail-vk0-f69.google.com with SMTP id j2sf4324208vki.15
        for <gclcip-std-proposals@m.gmane.org>; Sat, 14 Oct 2017 06:49:16 -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=oLdMIzyz90VzLBD4UqkzASzVvB+CZgqhfFhuBWAe7QY=;
        b=nbzBXU84n7PBhghCAULVI/6evOpJI06/Nmv73ZeGl1vL6hBnnfp6ZjWD1Ha+BBq8Pa
         ZhUN4U4tTCs9ihANEKcdJ/ILZyb2cMaEdAx9o6u4A8+hkJ/6D7GyRPtLHBXY0fXdM4XB
         X/SVg0z1BGQ0aUpzItS4n8dYZmTkjLl+GDEaIvsO1qELAlTR7X49D6ZoYwARc/F9tt2/
         anzAz5TmcZNiw3IWv/i7xAX81X+46EKj6fu13FxMc9Ju92V/n7fLt4rI0+tP3AQFp3B/
         tKOoDBsZf0loteMd+yxjzkLaBSh2jWjUyicuWra4adhNMtPHjaEnB/e0Q+Nf4Ioyp5rX
         XHXg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        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=oLdMIzyz90VzLBD4UqkzASzVvB+CZgqhfFhuBWAe7QY=;
        b=cGOn9PTXpjQPqhcr9p56NsYe79OUkih3f0VM2EFovQuKoTeFnUDqcInPozGpXhhFSA
         T3CS8z62ZD7n02smOs5Z0Ngh9anWolzSvmhcoKVkEF4dTe7W8ZD14CL2Ff68uD30PPTl
         /hGdiuyf16+WG9BMImzP/4V1g8z1wEe3lWdHqNpxZ1bReG4UBfsbJ0f/KJzQc0cAK6zJ
         KiHB5nUIE/QKHYfkH/R3PdrxzS0vOnj1/TpJr4wubUJQaUMWxRI0RuSUPGdyAX2vhY4w
         yomNWC8YiSV2qiL16fyXYAIkk79r5Cu9DAqaRccBw40kIXt3z5GR1xAnEz3Mes2agncI
         Bavw==
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=oLdMIzyz90VzLBD4UqkzASzVvB+CZgqhfFhuBWAe7QY=;
        b=AtMCIKF/hfs6pL1Gi2kauCsViMiXJmIUigztxJ9Kg+sJGbWbK+R17icb4TPiQ581im
         huXr/5UzC2ZBqBjWcrC/tSTLbklkgkZ0rorOghqU6Cbs0Ibg6GGHu1ToQ7LFZ5HdlFbL
         SRHRyYJGWSZTEw4t0+0QYOeOh7v5pFVUeeJBEXowGjswekESkwEVVx/peSxNQVE8J37j
         PCT/xGsj3S8T+ygHdeIOWE/XUnlZwvtvhUfv4anro0euAkJKoat69VHNsgVCzWxURC38
         nZfjQF2vBzQ9BMwo/uiadW8y1/ql5mW+hMPw0q5bKLhvGKFZchZVubX54+SVI4kYREUT
         s5hQ==
X-Gm-Message-State: AMCzsaXgVY413beMEmqyvcQOZ4n+rdriO7E/Ei/q2hwqxwD8/xxCv5/j
	ot7TuaiBXaicKHXPTGfLE495AQ==
X-Google-Smtp-Source: AOwi7QC6Qnoj+roZ6xi1qzpL0B/aKmoDaVPeF35nxT+K28fi8WejYcvWeeVYt97fzja3yBeMEb4z1w==
X-Received: by 10.176.28.18 with SMTP id a18mr2325466uaj.50.1507988955689;
        Sat, 14 Oct 2017 06:49:15 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.159.36.173 with SMTP id 42ls2368862uar.17.gmail; Sat, 14 Oct
 2017 06:49:14 -0700 (PDT)
X-Received: by 10.31.211.195 with SMTP id k186mr290676vkg.9.1507988954460;
        Sat, 14 Oct 2017 06:49:14 -0700 (PDT)
In-Reply-To: <b50be367-9a0c-4d62-a392-d2b4471d7403@isocpp.org>
X-Original-Sender: inkwizytoryankes@gmail.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:34898
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/34898>

------=_Part_1275_2037593031.1507988954008
Content-Type: multipart/alternative; 
	boundary="----=_Part_1276_848129416.1507988954009"

------=_Part_1276_848129416.1507988954009
Content-Type: text/plain; charset="UTF-8"



On Saturday, October 14, 2017 at 3:27:44 PM UTC+2, ejsvifq mabmip wrote:
>
> 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
>>>
>>>  
IMHO if check in `emplace_back` cost is too much for you, you probably 
create your own container of use some specialized one from SG14.
Vector cover 99% use cases, you are probably in 1% that is not included.

-- 
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/e5065ef4-4802-4241-8357-cfb93ba25bae%40isocpp.org.

------=_Part_1276_848129416.1507988954009
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Saturday, October 14, 2017 at 3:27:44 PM UTC+2,=
 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"><div><a href=3D"https://github.com/euloanty/cqwrteur-vector/blob/m=
aster/deque.cc" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=
=3D&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Feuloanty=
%2Fcqwrteur-vector%2Fblob%2Fmaster%2Fdeque.cc\x26sa\x3dD\x26sntz\x3d1\x26us=
g\x3dAFQjCNGBiMCI1zerDVpFHcXrHnfArSpJ3A&#39;;return true;" onclick=3D"this.=
href=3D&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Feulo=
anty%2Fcqwrteur-vector%2Fblob%2Fmaster%2Fdeque.cc\x26sa\x3dD\x26sntz\x3d1\x=
26usg\x3dAFQjCNGBiMCI1zerDVpFHcXrHnfArSpJ3A&#39;;return true;">https://gith=
ub.com/euloanty/<wbr>cqwrteur-vector/blob/master/<wbr>deque.cc</a></div><di=
v><br></div><div>Try this code.</div><div><br></div><div>BTW. deque is &quo=
t;slower&quot; than vector because of this dumb check if<br><br>On Saturday=
, October 14, 2017 at 9:24:37 AM UTC-4, <a>eulo...@live.com</a> wrote:</div=
><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;bord=
er-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">O2 wont eliminate=
 this cost. It is not optimization issue. I always use -O2 to compile my pr=
ograms<br><br>On Saturday, October 14, 2017 at 9:18:56 AM UTC-4, Todd Flemi=
ng 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 Saturd=
ay, 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 class=3D"gmail_quot=
e" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-l=
eft: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></blockquote><div>=C2=A0</div><div>IMHO if check in `emplace_ba=
ck` cost is too much for you, you probably create your own container of use=
 some specialized one from SG14.</div><div>Vector cover 99% use cases, you =
are probably in 1% that is not included.<br></div></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/e5065ef4-4802-4241-8357-cfb93ba25bae%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/e5065ef4-4802-4241-8357-cfb93ba25bae=
%40isocpp.org</a>.<br />

------=_Part_1276_848129416.1507988954009--

------=_Part_1275_2037593031.1507988954008--

.
