220 34892 <1550fc17-cf97-438d-9e7a-862f729adbf5@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Todd Fleming <tbfleming@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:18:56 -0700 (PDT)
Lines: 99
Approved: news@gmane.org
Message-ID: <1550fc17-cf97-438d-9e7a-862f729adbf5@isocpp.org>
References: <973f04da-1354-44f4-9d1f-23f04596b8dc@isocpp.org>
 <20171014085305.GA24512@fukushima.lysator.liu.se>
 <79c51b8c-6cc2-4872-8651-9dae513d1e21@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_14316_93442328.1507987136473"
X-Trace: blaine.gmane.org 1507987142 20289 195.159.176.226 (14 Oct 2017 13:19:02 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 14 Oct 2017 13:19:02 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDN5JUVZSIFBBQM5RDHQKGQETKNPDOY@isocpp.org Sat Oct 14 15:18:58 2017
Return-path: <std-proposals+bncBDN5JUVZSIFBBQM5RDHQKGQETKNPDOY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ua0-f200.google.com ([209.85.217.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDN5JUVZSIFBBQM5RDHQKGQETKNPDOY@isocpp.org>)
	id 1e3ML4-0003hm-Qx
	for gclcip-std-proposals@m.gmane.org; Sat, 14 Oct 2017 15:18:50 +0200
Original-Received: by mail-ua0-f200.google.com with SMTP id s9sf5220488uae.14
        for <gclcip-std-proposals@m.gmane.org>; Sat, 14 Oct 2017 06:18:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to: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=KjVkGfruSf90cNemE7/jRRMqdxYCo8gStGGPJs1ZhC8=;
        b=145ebIgq5vvxv/POX/rh9Mpd4vBOXCnnbwiomZo4y+gwecywxJhTLLlixTGLMUNk4S
         CbbdGLuFn1mwIUsp26eG7nrxYDQCpxeuGH6w/480t75kRjSIug3Cs8/1aS27BxL5mURn
         dPJDJt4LelGaUMStIhZ07/egPSZ3yLRoIxazTLic4XY/dECctG9vN4mMPT1JIZ6WE5ub
         rVIQ8beBuJX9L2xNcHldcebKj9Kx20BFMdpSSZXW6EIOvUPjIVMJ5vYtuEAfYDDBr8/T
         csorYIEMFE9QSLm5wvdtCR9Pfjz3bgks2DhR43ddJgepUv2jUOiGw1NsPz18yoDe7NEx
         JEvA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to: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=KjVkGfruSf90cNemE7/jRRMqdxYCo8gStGGPJs1ZhC8=;
        b=BlZM1hQtybofxwM0GuEvQyACIo4WcMzoDQ2aG1wva6ASXBAwjknjsX7jHZXToEcpc1
         fFmZ2fEnhjxXQc2msd82Bqnz1rbEF4Kl/kp1ngafhGkveSEdgb3S9ar4tA+LSImiIWMN
         kMZHbqH+5ulJq9Bf8azT4yWk4caorpx9y4ThNUHIik9NPn4NiiQq/7tpa5jaRfI1V6xb
         6yzyhPXmtJKNazdx85AwTo+bvyt8KXTsDClvYo29AMSL2UfsE4mVgoZJkNfHohsmBZZO
         U5xRFWREZ5mcGJtK3YSbyhjKc3xc3ddyp7ag4/tS4l3L0BCSxQ98aPHMfTFDpk5Cq0qH
         6faA==
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: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=KjVkGfruSf90cNemE7/jRRMqdxYCo8gStGGPJs1ZhC8=;
        b=qlzw3wg62Hng0enp0uOx8yyRfWOLAkAGuXINTnxpD7yTux7ZW67/jWG6GGROMWfpWP
         CuNYHky0kCCZ6A3k3/l4n+GlzFsT9mDoYx0nfnyuHPWPYye+LRu/j0XTBsMepUEwvDCZ
         zfFIBGi/EaxpNxvXI4+zbU9ldgvBM92tUVvzhhtsZ51UXvLtc7TgTzTbK3/9U2rR1Cr6
         vqZQo1fgl1b4cY1b9NbQUEzUfplhdpMWXIG2rHbJv216LEWtV9vsZ+bwiOWnQlSSPDgY
         7bRA1FLCV4xClrRRKAyk8xlPwLI4rXj17YQPvMi3T77D7o3i3rEE3nysI1KSx0XzVSW3
         YMHw==
X-Gm-Message-State: AMCzsaW1P5on9fXtHfSa/03XJTS94ALvGiIlR9cc+8XMaZrTXeuAQMJA
	wQ2us3juipEOgJC2s+q5zId8jQ==
X-Google-Smtp-Source: AOwi7QDrIOuflECkr2ozIlYsOabF/nK7nJv8a/4hpNl60MpYE+wNS7z60XqKHuIYroZiQ1r6zS0z5w==
X-Received: by 10.31.174.147 with SMTP id x141mr2263730vke.9.1507987138209;
        Sat, 14 Oct 2017 06:18:58 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.176.2.9 with SMTP id 9ls2388185uas.19.gmail; Sat, 14 Oct 2017
 06:18:56 -0700 (PDT)
X-Received: by 10.31.11.69 with SMTP id 66mr285966vkl.6.1507987136952;
        Sat, 14 Oct 2017 06:18:56 -0700 (PDT)
In-Reply-To: <79c51b8c-6cc2-4872-8651-9dae513d1e21@isocpp.org>
X-Original-Sender: tbfleming@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:34892
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/34892>

------=_Part_14316_93442328.1507987136473
Content-Type: multipart/alternative; 
	boundary="----=_Part_14317_361490490.1507987136473"

------=_Part_14317_361490490.1507987136473
Content-Type: text/plain; charset="UTF-8"

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/1550fc17-cf97-438d-9e7a-862f729adbf5%40isocpp.org.

------=_Part_14317_361490490.1507987136473
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<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-l=
eft: 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_quote" style=3D"margin:0;margin-left:0.8ex;borde=
r-left:1px #ccc 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>

<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/1550fc17-cf97-438d-9e7a-862f729adbf5%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/1550fc17-cf97-438d-9e7a-862f729adbf5=
%40isocpp.org</a>.<br />

------=_Part_14317_361490490.1507987136473--

------=_Part_14316_93442328.1507987136473--

.
