Date: Fri, 13 Sep 2024 08:53:05 -0400 From: Joe Schaefer <joesuf4@gmail.com> To: David Chisnall <theraven@freebsd.org> Cc: Pat Maddox <pat@patmaddox.com>, Alan Somers <asomers@freebsd.org>, Chris <bsd-lists@bsdforge.com>, Warner Losh <imp@bsdimp.com>, FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: The Case for Rust (in any system) Message-ID: <CAOzHqc%2BqMCXUnBJ5QJPCPqwfexmy_3S2zGpBg6Mo%2B9Ka=7rBVQ@mail.gmail.com> In-Reply-To: <2D0F93DC-36DA-4FB9-BFD2-D7678EC03CD7@FreeBSD.org> References: <CAOzHqcJ0rOR4CoL84WgZQNcgY2G9vuiHccE4XT_otJ2R51KJ3Q@mail.gmail.com> <2EE309BF-CE1D-48AD-9C53-D4C87998B4A0@freebsd.org> <CAOzHqcJs2Ls9rG-X9%2Bjsc=Z2XHvh_eo=5jyFSaTDc6kUMK8vPg@mail.gmail.com> <2D0F93DC-36DA-4FB9-BFD2-D7678EC03CD7@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000f7acad0621ffb432 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ok big guy. You win. On Fri, Sep 13, 2024 at 4:53=E2=80=AFAM David Chisnall <theraven@freebsd.or= g> wrote: > On 13 Sep 2024, at 08:59, Joe Schaefer <joesuf4@gmail.com> wrote: > > > That=E2=80=98s because you are a dork. > > > In case you were wondering, that was the point when you lost all > credibility in this thread. > > The point isn=E2=80=99t that calloc calls are faster than vector allocati= ons. > The point is that by changing the way you deal with arrays (as objects th= at > manage their own size, versus managing the sizes using up front > preallocations and dealing with their growth yourself), we can exchange > function calls for pointer dereferences. > > > And that=E2=80=99s precisely the change you get by calling .reserve with = the > expected size. And the speedup tends to be exactly what you claimed you > got. > > David > > > --000000000000f7acad0621ffb432 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto">Ok big guy. You win.</div><div><br><div class=3D"gmail_qu= ote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Sep 13, 2024 at 4:53=E2= =80=AFAM David Chisnall <<a href=3D"mailto:theraven@freebsd.org">therave= n@freebsd.org</a>> wrote:<br></div><blockquote class=3D"gmail_quote" sty= le=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div s= tyle=3D"line-break:after-white-space">On 13 Sep 2024, at 08:59, Joe Schaefe= r <<a href=3D"mailto:joesuf4@gmail.com" target=3D"_blank">joesuf4@gmail.= com</a>> wrote:<br><div><blockquote type=3D"cite"><br><div><div dir=3D"a= uto" style=3D"font-size:1rem;font-style:normal;font-variant-caps:normal;fon= t-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-tr= ansform:none;white-space:normal;text-decoration:none;font-family:-apple-sys= tem,"helvetica neue";word-spacing:1px;background-color:rgba(0,0,0= ,0);border-color:rgb(49,49,49);color:rgb(49,49,49)">That=E2=80=98s =C2=A0be= cause you are a dork.=C2=A0 </div></div></blockquote><div><br></div><div>In= case you were wondering, that was the point when you lost all credibility = in this thread.</div><br><blockquote type=3D"cite"><div><div dir=3D"auto" s= tyle=3D"font-size:1rem;font-style:normal;font-variant-caps:normal;font-weig= ht:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transfor= m:none;white-space:normal;text-decoration:none;font-family:-apple-system,&q= uot;helvetica neue";word-spacing:1px;background-color:rgba(0,0,0,0);bo= rder-color:rgb(49,49,49);color:rgb(49,49,49)">The point isn=E2=80=99t that = calloc calls are faster than vector allocations. =C2=A0 The point is that b= y changing the way you deal with arrays (as objects that manage their own s= ize, versus managing the sizes using up front preallocations and dealing wi= th their growth yourself), we can exchange function calls for pointer deref= erences.</div></div></blockquote><div><br></div><div>And that=E2=80=99s pre= cisely the change you get by calling .reserve with the expected size.=C2=A0= And the speedup tends to be exactly what you claimed you got.</div></div><= /div><div style=3D"line-break:after-white-space"><div><div><br></div><div>D= avid</div><div><br></div></div><br></div></blockquote></div></div> --000000000000f7acad0621ffb432--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOzHqc%2BqMCXUnBJ5QJPCPqwfexmy_3S2zGpBg6Mo%2B9Ka=7rBVQ>