High cost of failed Math.*Exact calls
Chen Liang
chen.l.liang at oracle.com
Fri Dec 13 04:44:52 UTC 2024
Seems what we desire here is an "exact or alternative value" model instead of an "avoid overflow" model. This sounds interesting - can you showcase any related ruby behavior using this model?
I think an alternative can be *IfExact that returns a nullable value, if we do not need more information about the failure. Such a model is flattenable in the current programming model of Valhalla and can fulfill some of our needs. (I actually wonder if C2 can already inline and escape analysis in such a scenario)
Unfortunately, before stack inlining drops, we are stuck with some tradeoffs - for example, current APIs still stick with Optional as it offers fluent code, which nullable types currently lack, even when we are promised a more flexible nullable type in the current roadmap of Valhalla.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20241213/087c5f07/attachment-0001.htm>
More information about the core-libs-dev
mailing list