Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122674 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id A464C1ADA7B for ; Mon, 18 Mar 2024 00:05:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1710720355; bh=eKaBEg+zx1mlCby9JO1vUYqPpGH0XlH+8Cnr0AdIxE4=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=Emx5asci6gnblay/IB5Wm5gQxAC70OESqnbVuA7Y+fZoEVSTTM21tC7LUZZ8p9hC7 yL3ba3NyW88goiKkGvCDXe1OWZ4O1tWluZr5chrFb5bYSVxaCpYLFg4QlZi1kQz2fd O7YZPsBoNHhIxJWeyLQKfNOKbCKhCTYavtfxNgnk+frqHpR1PwGM9hkD4J5oobj6Y7 kEjfe37nsHKY9hWHFrHffqUUzkZUr66Y8hUfkUMMDTvXYk5lfh5EARzVURJ070QgxZ uBdzG8nZkRgct23+NxTer+GuaigJ6bQF+hCoX/edOKXaaYdQK3dYBdopmW2I/pdK8N GN1gE7VyrtX3A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BCE7E180A30 for ; Mon, 18 Mar 2024 00:05:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail.sakiot.com (mail.sakiot.com [160.16.227.216]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 18 Mar 2024 00:05:51 +0000 (UTC) Received: from smtpclient.apple (unknown [117.55.37.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.sakiot.com (Postfix) with ESMTPSA id 6B0D2401E7; Mon, 18 Mar 2024 09:05:30 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1710720330; bh=eKaBEg+zx1mlCby9JO1vUYqPpGH0XlH+8Cnr0AdIxE4=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=Ii6LVEz4yzQ1QB+XKYHhr4Nlt9l7FRnfhscYo6zHfZSUmXUngrgC7ZAUWtNYIlKQy RNA9pigkAM3S0MC1gzuqENkaIcoY5ifgBpPIRQ2yM/gVoIicB7kFcG37kE4OZA4RCm TAS7L0DdvtzUsO84Hj84X2jaIuywAENZJDhJLMoc= Content-Type: text/plain; charset=us-ascii Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: [PHP-DEV] Supporting object types in BCMath In-Reply-To: Date: Mon, 18 Mar 2024 09:05:18 +0900 Cc: Barney Laurance , internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <7FC4C53E-BDA1-40DA-BFE3-EE068C63444F@sakiot.com> References: <09F87F91-6538-48D2-9E34-0296E02CCC1A@sakiot.com> To: Jordan LeDoux X-Mailer: Apple Mail (2.3731.700.6) From: saki@sakiot.com (Saki Takamachi) Hi Jordan, > Using a BCNum inside a loop is the use case, where every loop would = result in memory allocation for a new object, as well as the overhead of = the constructor, etc. >=20 > Granted, only people who REALLY know what they are doing should be = doing this. Though my library which essentially IS a wrapped for BCMath = that is upgradeable if you install other extensions (like ext-decimal) = does support both, I suggest using primarily immutables in my docs. >=20 > That said, the C library itself for BCMath is insanely inefficient as = far as arbitrary precision math goes, so I would suggest that people = don't get their hopes up too much on the performance front. I just sent an email, and you're right about performance. Therefore, the = point of this proposal seems to be simply to improve convenience. Regards. Saki=