Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122675 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 9322D1AD8F6 for ; Mon, 18 Mar 2024 00:54:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1710723307; bh=/XAMginf/VN++k5DHqzS19yLHR2SSxr5tRDBakbnrrQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=U0CJ8Axle7RcWNaBSyvrDrYKYOXQS3LUyQ2/ypqsAtxCoTqvByf8OLlOt7+Db/TLC ThZQmsOWUP3/h4iiJlvSpqzQ0EfhsMNBv4X6vHhW4DrFebMy7gOgafpAupTjLojSU1 +NpP7j8FAuOKvO0CQcLqQL+vqGkH+Aixy7RmAUzljIm7+GrGXYFSvf3JAnfaT9xq2Q bbxGJAedLLjcsLO7afNN122nKCY5Qo0nkGhFArP+Yl8MhJWUxETdwNcFOCpQClJ4Pu /bPcvpzPsqqbKvDsQopCVun9DRdjhPV03qEVOjjKLGvWhvo6FQf19OVaBgQ2sGg8Z1 Bp4rzP8dQeyHQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E1BA1180718 for ; Mon, 18 Mar 2024 00:55:06 +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,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (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:55:06 +0000 (UTC) Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-29b7164eef6so2997822a91.2 for ; Sun, 17 Mar 2024 17:54:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710723286; x=1711328086; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/XAMginf/VN++k5DHqzS19yLHR2SSxr5tRDBakbnrrQ=; b=Sp9YXymBunFMoDvdd6oTd7ZIA4qL0zqx4TVNWyQaM4fLwI3U77dh2nRPKzoqbKyCe1 UGX81WJGnOWjdEPTx45kb2BnE2uXMmFI785rD2qARCDVZYorposDPeLVFuZzNY6C1G+b km2FiTK5pBygG8OTNEM/tqkhiho0BwpBeejan+o1NT51vRC+38eFHTs8w8Wbukia5EB2 lIlCshpPO6yBva8OC07BHVnn5+OWRn3hoNE76n8BtJ6fKhTb2PyNb7S7Mkp0REd6hDt8 0QQkwAwQOikxzgVRvH2ehn3yVF/2g7AxekBVVg0vVYFH/QTih8070EOHHO6QdhazNFXD L0zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710723286; x=1711328086; 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=/XAMginf/VN++k5DHqzS19yLHR2SSxr5tRDBakbnrrQ=; b=CKidiyPo6fV0Ks6CeB4auXCPVzQP75wqfwU5CctObFFcssodbC5vw/gsL1lxelZPNg ZIEzmyDX137s7Bxaq9VCfJ7yfVxt2KNdoU1BPIxyK16SSD+wzCsLydIGb7xkS29MzgAw fX8HwZdQnA3Ww++NpSm+W2vFLIHP4pSUYvMtqXQ0n7MhbvWjMJZX4QU9QjfYd2NkUz3n 2z5MWGwSBkyyaPSBKO/5P6ZICXdxsGe5Uu+6bOd1oZlVF5kkJXDObFSbGP61l6RbzoD5 3/GflNuywLMEqLfo8bvGEX16WBLSh6w/coufzIqXdfATflgqOHKIjCONYkwMJOHHqZLn dlwg== X-Forwarded-Encrypted: i=1; AJvYcCVh4zNRgc9aoOdTo9ceKBlrDeThYb2N7DnGHv11TNVZKG3aKKwZrfIOlHr3vToZeWYb2XteZZWOLAaXUD6LGWckAzBw1t6Z8g== X-Gm-Message-State: AOJu0YyzF/tK/+XOrO0UNp+YrkmIURuZZaUYdaochH/zSzswcfDOmyRE zmNNyL+5deiCDfm2gTZNQ2SUTX5DE4TbY2T/xjYqM1LER1T5xnXC9OzdFYsLAsvRDFRyl8JXoWK PE4z4SLdLqCamHcaQ7Z+7GMdEHXI= X-Google-Smtp-Source: AGHT+IGZshur4bVMHDFgkqb0ZMtrEk6JiwWyMDO7uKgDc2jqvTBM/NiZxDI7Nb0391rNnP6Q/84+ZtLeLF77IGXyq3c= X-Received: by 2002:a17:90a:b109:b0:29d:f7d2:ccc8 with SMTP id z9-20020a17090ab10900b0029df7d2ccc8mr6882784pjq.0.1710723286004; Sun, 17 Mar 2024 17:54:46 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: <09F87F91-6538-48D2-9E34-0296E02CCC1A@sakiot.com> <7FC4C53E-BDA1-40DA-BFE3-EE068C63444F@sakiot.com> In-Reply-To: <7FC4C53E-BDA1-40DA-BFE3-EE068C63444F@sakiot.com> Date: Sun, 17 Mar 2024 17:54:26 -0700 Message-ID: Subject: Re: [PHP-DEV] Supporting object types in BCMath To: Saki Takamachi Cc: Barney Laurance , internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000c581950613e4cd52" From: jordan.ledoux@gmail.com (Jordan LeDoux) --000000000000c581950613e4cd52 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Mar 17, 2024 at 5:05=E2=80=AFPM Saki Takamachi wr= ote: > 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. > > > > Granted, only people who REALLY know what they are doing should be doin= g > this. Though my library which essentially IS a wrapped for BCMath that is > upgradeable if you install other extensions (like ext-decimal) does suppo= rt > both, I suggest using primarily immutables in my docs. > > > > 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 I've done a lot of performance tuning on my arbitrary precision library, and will simply state for everyone here that I think the amount of development effort involved in improving performance of the BCMath library is almost certainly going to see a return on your effort that is not worth it. There have been discussions over the last year on possibly working on bundling a new arbitrary precision C library and providing something that is performant enough to be generally useful in core, but that's not even at the RFC stage, just investigations. I wouldn't say that improving BCMath is a waste of time, but there is also probably lower hanging fruit once you get past things like Saki has here. DevEx improvements. Jordan --000000000000c581950613e4cd52 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sun, Mar 17, 2024 at 5:05=E2=80=AF= PM Saki Takamachi <saki@sakiot.com> wrote:
Hi = Jordan,

> Using a BCNum inside a loop is the use case, where every loop would re= sult in memory allocation for a new object, as well as the overhead of the = constructor, etc.
>
> Granted, only people who REALLY know what they are doing should be doi= ng this. Though my library which essentially IS a wrapped for BCMath that i= s upgradeable if you install other extensions (like ext-decimal) does suppo= rt both, I suggest using primarily immutables in my docs.
>
> 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= 9;t get their hopes up too much on the performance front.

I just sent an email, and you're right about performance. Therefore, th= e point of this proposal seems to be simply to improve convenience.

Regards.

Saki

=

I wouldn't say that improving BCMath is a waste of = time, but there is also probably lower hanging fruit once you get past thin= gs like Saki has here. DevEx improvements.

Jordan<= br>
--000000000000c581950613e4cd52--