From nobody Fri Sep 13 11:28:43 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 4X4sWj19bPz5Wm96 for ; Fri, 13 Sep 2024 11:28:49 +0000 (UTC) (envelope-from paulf2718@gmail.com) Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (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 4X4sWh0Hmvz43TJ for ; Fri, 13 Sep 2024 11:28:48 +0000 (UTC) (envelope-from paulf2718@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=DyGgFMpL; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of paulf2718@gmail.com designates 2a00:1450:4864:20::32d as permitted sender) smtp.mailfrom=paulf2718@gmail.com Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-42cde6b5094so16506735e9.3 for ; Fri, 13 Sep 2024 04:28:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726226925; x=1726831725; darn=freebsd.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=oOMjW5N+9juq6yD58kJ+ELDGcb0vZGi4MbdRbwX+Skc=; b=DyGgFMpLu6NMFvQTQXOHaMejpUtThkcxjBDLJmhh53s/g0leewZPIqUDUD175xp0QD PPA7mtqAh1fr1/uSTDBt8Vpcl6bifDTskElMru7nKCgv9G5EUwBU/3Pymib4+bYMAVlj lkU91Gd09pGISe9DVO2FUJ2IIj8YBbWC9idPcO3dwJTdcK3yxuLQNlxMo9BJDZ1aofRm 5DZflMyeOqHRqIvEuPdgRAdvY0SJmyGeI+3OW4i2DRVq75GKshrCUZp1WKxN4ozYHAis AZkL1ORigLPKv3Iw6sQgZQpX9PJSZGPadGTDW4PaCa+sqA+gTKQl27PXcqms+fJoh0a7 Mrrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726226925; x=1726831725; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oOMjW5N+9juq6yD58kJ+ELDGcb0vZGi4MbdRbwX+Skc=; b=grL7wOdm71Zw9tTrThDntAIvTDL/6AMDdnfE4xydZsMB+Uy0Pb5TiaHum+JRI9Ggto /4rBIqYbc3qozYDwacrjzqdYZ53QS0OviYENnkq+cRWRZylIsEMROR0EchxRd/kmr979 TG/R3jW28+MPWiAnr4bNLvb9/tdZ4xkaQvpEcHEBEPtzQ0GCP9+f1U7r198bRPq+30xv YLiKCP0tYUFdaCm0nia3TIn03nivcKUBqvsYBX+uLNnBlTYcUm2VX3g/eaDmEjB8IL6L /hSWvRljCUBfJhy9MmYiWDSDPAFX9eXmB4hwqjz0SOyQcwPAzFOhS5HK/yYs+2zCiy9R HHLA== X-Gm-Message-State: AOJu0YyC8Q36YfxRBE7BUDYvPpJLfzXU/daNy4GrdyB1TWx2we6l14oc NK78dbvtMGWLKtl+xYUujKXYtLcXM1tMVMa8hzDhPm7XV5e+1Yo48l+YBA== X-Google-Smtp-Source: AGHT+IHCFDKQ1cdaE9EnsstJhKVi8M5dQDsXQIpFxu/CEUYQWDh1tGldNVptLtvRDHh8KCR5xeCnbQ== X-Received: by 2002:a05:600c:3b93:b0:42c:b63e:fe91 with SMTP id 5b1f17b1804b1-42cdb57c176mr48258635e9.24.1726226924759; Fri, 13 Sep 2024 04:28:44 -0700 (PDT) Received: from ?IPV6:2a01:cb15:801f:7500:1aa9:5ff:fe16:2efb? ([2a01:cb15:801f:7500:1aa9:5ff:fe16:2efb]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42d9b182004sm21305675e9.46.2024.09.13.04.28.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Sep 2024 04:28:44 -0700 (PDT) Message-ID: Date: Fri, 13 Sep 2024 11:28:43 +0000 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 User-Agent: Mozilla Thunderbird Subject: Re: The Case for Rust (in any system) To: freebsd-hackers@freebsd.org References: <2EE309BF-CE1D-48AD-9C53-D4C87998B4A0@freebsd.org> Content-Language: en-US From: Paul Floyd In-Reply-To: <2EE309BF-CE1D-48AD-9C53-D4C87998B4A0@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.54 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_SPAM_SHORT(0.45)[0.452]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FREEMAIL_FROM(0.00)[gmail.com]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TO_DN_NONE(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::32d:from] X-Rspamd-Queue-Id: 4X4sWh0Hmvz43TJ On 13-09-24 06:17, David Chisnall wrote: > On 13 Sep 2024, at 02:34, Joe Schaefer wrote: >> >> I just completed a month long project to port a C++ codebase that used vectors for array allocations back to using C‘s calloc. For a 15% increase in memory footprint, batch jobs that took three days to complete now finish in 10-12 hours. > > This sounds highly dubious given that std::vector is a very thin wrapper around malloc. From your description, I would expect the same speedup with some judicial use of .reserve(). And I forgot to say. I'm sure that John Lakos has an opinion on the use of PMR that could well be applicable in this case. Does Rust have anything like PMR? A+ Paul