From nobody Fri Sep 13 12:53:05 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X4vPC4L6Fz5WxKM for ; Fri, 13 Sep 2024 12:53:19 +0000 (UTC) (envelope-from joesuf4@gmail.com) Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X4vPB6d0wz4KhC; Fri, 13 Sep 2024 12:53:18 +0000 (UTC) (envelope-from joesuf4@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-42cba8340beso19866705e9.1; Fri, 13 Sep 2024 05:53:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726231997; x=1726836797; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=hSb8EOaHCwpNh0qolxyhoejxIvghkO8s2pr5sWUmNZ4=; b=eoXs6vIa1KW398EOHVgV5WKbSRoDKezvSFo0vvr84E5wlsjX6fp5xi9O/4cWD0XUvp Qs6S70Pr0eVYcXm2RrlbsuOZt5x850VaUm7VzFPoidG4T62UkMwxpXbxaqxXGW7ua1gP Zk3fE2pU+wAuq3kj3bbRn8cbPCikutDX+hA1sivAPieTL7K+JHLZG8IeBjvlAbfSMW5o RzCkeJ5Go80peKEd0Dlj9B2sDqtRIkk7JdXcnCgDUoO2HwDl85MQgz6z5DQOEr7FUNCp 2iU5mYDbneL+5Qr1FyAa+HrYdt2bbg0I7yZFajovVCopGcsw7g9kPCjPRInWcVP8TRG/ jodA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726231997; x=1726836797; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hSb8EOaHCwpNh0qolxyhoejxIvghkO8s2pr5sWUmNZ4=; b=k8hNJbUf5Yt2eptndCWQXxDRuYPOBvHANc3zGutlIbnv4veCnm/glSucrpy/l5Ocyt aQ6hjLhGgut0z2y3J21rowO+/hPXthnHAzXYPIwZFW8/Ishc4fh82wr9VV9JBVFrPUWA 6uPW994Z4gYFosyhxNDi5mwmLs63QbHZHZk5EI5uGMssMfC7Dx0KK1VA1VY0Jw48pDHs Mx7OmgKd4mYhVUHu0S9Iilf5KzrgZgq1NiKPUkVA0IDdA5vLOt0FH92qbv2rZUE1m8/p GPyKyismSv1xkfE2mvZUPWA5GAOMATAX6PuHEWEw/TI4aRCFRsVMJcsjGBDZNYHhBQHS 4FMg== X-Forwarded-Encrypted: i=1; AJvYcCUT2FLN1f384Ii2t5zVXqn9x1vbrRjOacO7dxsArxL8iHTluEr/I8/iTK9DzuOubhcbjIVeyZ08frxO3FENyMzT@freebsd.org, AJvYcCXMZdYktTummv2pyeNO5M/M0jyaCKcDZAtsYdDxWD33lIqnBhNCbIwr+RKDR/QQ4cyy+VvfX2MR@freebsd.org X-Gm-Message-State: AOJu0YwEo+F/QWrmFow8oF/1/GGmMTu0gwVA2TUF2CyTObhEXEZqAMIy OO7fMPhVl99mE9mTF2+CSPdJyhOcBKh89qJR5EkIeDaFWa6EygMn4pppQ6i5rOYntD54mw+t5f1 24jdCXQauy7nimAm+d0U/d7BQLpZdpiqh X-Google-Smtp-Source: AGHT+IEs2oO5FkjYWxawPnvbX2Tara2EG7mFOxcXkDj6+8PuLlhFFt6qMYJLwdkw3MdwdDpxMytL5N/83dFfOhS6aro= X-Received: by 2002:a5d:4107:0:b0:378:8b56:4665 with SMTP id ffacd0b85a97d-378c27f952emr3975789f8f.24.1726231996769; Fri, 13 Sep 2024 05:53:16 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 References: <2EE309BF-CE1D-48AD-9C53-D4C87998B4A0@freebsd.org> <2D0F93DC-36DA-4FB9-BFD2-D7678EC03CD7@FreeBSD.org> In-Reply-To: <2D0F93DC-36DA-4FB9-BFD2-D7678EC03CD7@FreeBSD.org> From: Joe Schaefer Date: Fri, 13 Sep 2024 08:53:05 -0400 Message-ID: Subject: Re: The Case for Rust (in any system) To: David Chisnall Cc: Pat Maddox , Alan Somers , Chris , Warner Losh , FreeBSD Hackers Content-Type: multipart/alternative; boundary="000000000000f7acad0621ffb432" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Queue-Id: 4X4vPB6d0wz4KhC --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 wrote: > On 13 Sep 2024, at 08:59, Joe Schaefer 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
Ok big guy. You win.

On Fri, Sep 13, 2024 at 4:53=E2= =80=AFAM David Chisnall <therave= n@freebsd.org> wrote:
On 13 Sep 2024, at 08:59, Joe Schaefe= r <joesuf4@gmail.= com> wrote:

That=E2=80=98s =C2=A0be= cause you are a dork.=C2=A0

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 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.

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>

D= avid


--000000000000f7acad0621ffb432--