From nobody Fri Sep 13 06:17:20 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 4X4kcZ0mcMz5W2Cw for ; Fri, 13 Sep 2024 06:17:34 +0000 (UTC) (envelope-from theraven@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X4kcZ0DLvz4H84; Fri, 13 Sep 2024 06:17:34 +0000 (UTC) (envelope-from theraven@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726208254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S4ePuBQqksLzUYoAShofYu7YiCDSqlOcJDagYj+vg1I=; b=ZJdY3RBtkLyH/UAFMrmdXdtmGyGSyo9gjP4mtDe4RK7yYuVWUNh5gQV16X8j0morxbGYsm cR3D/7xR5XYIgJbp9Abx6Ld9bpuREZNSTCVbqSDPSt0u6oUDSJYZqE8/2Po/7512i05DbU +O4igKFMiIdZfBBYJY7y25ElFeA1xKgU+0pVW0NuG6O6WVtNCxw6lUvrd2MkyKwiQxyU+F BBDqCZBf6z3QhmrieOM/v2gtycjjyRp/0+eABSTzPWmJOrs7yWS6vXDzKYHMDkqhZUpFUt +NDpBFCIMFh04T6ssOfFBe7J+lwErDn2XAHukJeuRz8KKTsQrpukGlp9gkSzgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726208254; a=rsa-sha256; cv=none; b=OtcVQ5C3Iwm+REB2tfWapWtZZ2h+VKZ/V239tnoOgzDL3rhq86EczVx//lbJJqoGa64Llm aBQces+CE00kXKf5rAjqK963vsUpafYfjA+hAmwVeWddS2QKcpFbjPDnwmnFOH/jNpR+fA AXE44qpHjg2PMPQ4saIX6ZG9udL82Nkmkp15HQOZzVgksgeUP5B6f1/ZSPo8vQ9amUJ86H PGrMTbjNu08vyCBxmn7O1WYMGS0r43YhqrIwuZwslVDkQyHdHZK0/+uq/xpkW+TYgZT8kq J1JTtdUHK+YXm/IE1oEjT+ybG8YSLjqS1FIW/i8F0cazkAwGjtCvjknGx2mMKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726208254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S4ePuBQqksLzUYoAShofYu7YiCDSqlOcJDagYj+vg1I=; b=HsPkEe5xpqM8NIknrTXsY4ux3MxMEFSO4EB1Ny5UwWS3+W4+GpOeYIRrlEK7iOh6I+fOkV B07xl2K+XERJXpjv+AJ7Nmsvrb8AQOsm867d5PSzCxx8MpgxJdNR/4iFDHHseH+ZaYfomq FpMbCSW1gAtPWO3/09chn6gsAis4saY7N5RxvwA4ELTCPQQxHnmBG2oBmulKnD9F0657hG kg2LWIHDmsRxBA3Enmeqm/eRQxrGml+JFlfoMGzIz/uXegJVjx864kKK8WcXTU+DlpfsfR o0tHeYloqcStKLQX5sZIgX+O7F+Y37c1yyz8C/LvZO/PzEyTI2WGKPuT2bHSBw== Received: from smtp.theravensnest.org (smtp.theravensnest.org [45.77.103.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: theraven) by smtp.freebsd.org (Postfix) with ESMTPSA id 4X4kcY6kQ2z12VL; Fri, 13 Sep 2024 06:17:33 +0000 (UTC) (envelope-from theraven@freebsd.org) Received: from smtpclient.apple (host109-155-136-107.range109-155.btcentralplus.com [109.155.136.107]) by smtp.theravensnest.org (Postfix) with ESMTPSA id EA8016626; Fri, 13 Sep 2024 07:17:32 +0100 (BST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: David Chisnall 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 (1.0) Subject: Re: The Case for Rust (in any system) Date: Fri, 13 Sep 2024 07:17:20 +0100 Message-Id: <2EE309BF-CE1D-48AD-9C53-D4C87998B4A0@freebsd.org> References: Cc: Pat Maddox , Alan Somers , Chris , Warner Losh , FreeBSD Hackers In-Reply-To: To: Joe Schaefer X-Mailer: iPad Mail (21G93) On 13 Sep 2024, at 02:34, Joe Schaefer wrote: >=20 > I just completed a month long project to port a C++ codebase that used vec= tors for array allocations back to using C=E2=80=98s calloc. For a 15% incre= ase in memory footprint, batch jobs that took three days to complete now fin= ish in 10-12 hours. This sounds highly dubious given that std::vector is a very thin wrapper aro= und malloc. =46rom your description, I would expect the same speedup with so= me judicial use of .reserve(). David=