Open ShiinaSekiu opened 1 month ago
Thank you very much! There are probably a handful of locations, where it is possible to get around throwing and catching.
The more pressing issue wrt. performance is not rooted in this project, though, but in KmmResult
, which cannot be a value class, as it would make it impossible to export it to an XC framework. Thus, catching
incurs a performance hit. At the same time runCatching
catches more than it should, so we require catching
.
By the way, why doesn't the peek()
method of this class have a corresponding peekOrNull()
method?
I'll not that down for improving API docs. peek already returns null
, if no more children are left. All the feedback you have provided so far is really appreciated!
The improved docs are part of #151
KmmResult 1.9.0 will be part of the next release, significantly reducing overhead, even though the same number of exceptions are thrown.
KmmResult 1.9.0 will be part of the next release, significantly reducing overhead, even though the same number of exceptions are thrown.
This would require us to go through and review catching
uses/convert them to catchingUnwrapped
, to my understanding?
https://github.com/a-sit-plus/signum/blob/e8f9bd4a0be5a9018e6e4ffe137b22191b06c1e1/indispensable/src/commonMain/kotlin/at/asitplus/signum/indispensable/asn1/Asn1Elements.kt#L432-L443