Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122656 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 193821AD8F6 for ; Sat, 16 Mar 2024 12:52:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1710593573; bh=msjs7Uiw89jXz1o68+2hwPfsEsO7VKTP+vdloxqiJdw=; h=From:Subject:Date:References:Cc:In-Reply-To:To:From; b=fYj2fAOHSgTb9dGEAKfrJC/rHbk8TdfFtb2GJR4pEA0B6e2LjoT6l9LR1++9mnVA4 we0MRgNTwyAtgzffyH06srozdlW89+vfvj39p9wGBdo70Xzas2LikqXEHYQ9YQaqNM 3aipYMliH43dvzjoobkfnAvOkinpza7RGrAXJA/qaOW+PII5+tZ8KOZbgt/Nkq8z8I E3SuVhXy7n+x0UC+E13IOh1BvwbimEy7gcOaCq/6TQFVWFxX6U5XS230qF9ttJqX+B 0p6MSEUhGlRNqUCx2+f83P1liS+NyCPDpuJaCSxGGAMt7J7WTkU91+Wf6ZeMVlUFfx vlRl4R6UuEKmg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AE27F18006E for ; Sat, 16 Mar 2024 12:52:51 +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 ; Sat, 16 Mar 2024 12:52:50 +0000 (UTC) Received: from smtpclient.apple (unknown [117.55.37.250]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.sakiot.com (Postfix) with ESMTPSA id DE049401EB; Sat, 16 Mar 2024 21:52:29 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1710593549; bh=msjs7Uiw89jXz1o68+2hwPfsEsO7VKTP+vdloxqiJdw=; h=From:Subject:Date:References:Cc:In-Reply-To:To:From; b=S9sju+lnefUTzLkWXTdBhF3EOvs2zte6+ceQvq/Ja6wDwBDEfvRgIvaTp6pBjE+Mq kNkcTYfQJrmD9MfZg4KjS9NLiZ0EkHTbWCYopq0dpsE3KxbNyH1j9flu34PdlEI9CH FIqJ6X/QvNSuzXkQmI8T7BGXTsOVxmeasuNHLDh8= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net Mime-Version: 1.0 (1.0) Subject: Re: [PHP-DEV] Re: Supporting object types in BCMath Date: Sat, 16 Mar 2024 21:52:16 +0900 Message-ID: <0E3F2F0C-FC33-4511-852B-80EA00EA65AE@sakiot.com> References: Cc: internals@lists.php.net In-Reply-To: To: Niels Dossche X-Mailer: iPhone Mail (21D61) From: saki@sakiot.com (Saki Takamachi) Hi Niels, > One advantage of a new API is that it could be more efficient than the cur= rent API. > The current API takes input as strings and outputs strings as a result, an= d therefore always has to reconstruct the BCMath internal state. > By keeping everything inside an object you could keep the internal state, i= mproving performance. Thanks for your feedback. I overlooked the cost of rebuilding the internal s= tate. I'll give it a try and see if there's a significant difference in perf= ormance. I also noticed earlier that it may be better in some convenience aspects, su= ch as the way to compare values. e.g. ``` $bcnum1 > $bcnum2 // bool ``` First, I'll try creating a simple prototype. Regards. Saki=