Date: Fri, 13 Sep 2024 09:53:43 +0100 From: David Chisnall <theraven@FreeBSD.org> To: Joe Schaefer <joesuf4@gmail.com> 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: <2D0F93DC-36DA-4FB9-BFD2-D7678EC03CD7@FreeBSD.org> In-Reply-To: <CAOzHqcJs2Ls9rG-X9%2Bjsc=Z2XHvh_eo=5jyFSaTDc6kUMK8vPg@mail.gmail.com> References: <CAOzHqcJ0rOR4CoL84WgZQNcgY2G9vuiHccE4XT_otJ2R51KJ3Q@mail.gmail.com> <2EE309BF-CE1D-48AD-9C53-D4C87998B4A0@freebsd.org> <CAOzHqcJs2Ls9rG-X9%2Bjsc=Z2XHvh_eo=5jyFSaTDc6kUMK8vPg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On 13 Sep 2024, at 08:59, Joe Schaefer <joesuf4@gmail.com> wrote: > > That‘s 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’t that calloc calls are faster than vector allocations. The point is that by changing the way you deal with arrays (as objects that 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’s 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 [-- Attachment #2 --] <html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">On 13 Sep 2024, at 08:59, Joe Schaefer <joesuf4@gmail.com> wrote:<br><div><blockquote type="cite"><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><div dir="auto" style="font-size: 1rem; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: -apple-system, "helvetica neue"; word-spacing: 1px; background-color: rgba(0, 0, 0, 0); border-color: rgb(49, 49, 49); color: rgb(49, 49, 49);">That‘s because you are a dork. </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="cite"><div><div dir="auto" style="font-size: 1rem; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: -apple-system, "helvetica neue"; word-spacing: 1px; background-color: rgba(0, 0, 0, 0); border-color: rgb(49, 49, 49); color: rgb(49, 49, 49);">The point isn’t that calloc calls are faster than vector allocations. The point is that by changing the way you deal with arrays (as objects that 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.</div></div></blockquote><div><br class="Apple-interchange-newline"></div><div>And that’s precisely the change you get by calling .reserve with the expected size. And the speedup tends to be exactly what you claimed you got.</div><div><br></div><div>David</div><div><br></div></div><br></body></html>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2D0F93DC-36DA-4FB9-BFD2-D7678EC03CD7>
