Re: Supporting object types in BCMath
| From: | Jordan LeDoux | Date: | Sun, 17 Mar 2024 23:52:04 +0000 |
| Subject: | Re: Supporting object types in BCMath | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-122671@lists.php.net to get a copy of this message | ||
On Sat, Mar 16, 2024 at 8:39 AM Saki Takamachi <saki@sakiot.com> wrote:
> Hi Barney,
>
> Thanks, that's what I was starting to worry about too. It seems like a
> good idea to support only immutability, as you say earlier in your proposal.
>
> Regards.
>
> Saki
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 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.
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.
Jordan