Re: Re: Supporting object types in BCMath
| From: | Saki Takamachi | Date: | Sat, 16 Mar 2024 12:52:16 +0000 |
| Subject: | Re: Re: Supporting object types in BCMath | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-122656@lists.php.net to get a copy of this message | ||
Hi Niels,
> One advantage of a new API is that it could be more efficient than the current API.
> The current API takes input as strings and outputs strings as a result, and therefore always
> has to reconstruct the BCMath internal state.
> By keeping everything inside an object you could keep the internal state, improving
> performance.
Thanks for your feedback. I overlooked the cost of rebuilding the internal state. I'll give it
a try and see if there's a significant difference in performance.
I also noticed earlier that it may be better in some convenience aspects, such as the way to compare
values.
e.g.
```
$bcnum1 > $bcnum2 // bool
```
First, I'll try creating a simple prototype.
Regards.
Saki