AwesomeNumbersKit Benchmarks #108
Replies: 2 comments 8 replies
-
I don't mind. I haven't included benchmarks because I haven't measured it against any other implementation, so I appreciate that you did. I'm curious, however, about that string conversion. Did you use the correct encoding/decoding methods? Because I'm aware that the performance is garbage for Apple's default implementation (#60). Edit: for clarity, I'm asking which pair of methods you used: String(_:radix:) ❌
UInt256(_:radix:) ❌
String(encoding:radix:) ✅
UInt256(decoding:radix:) ✅
UInt256.decodeBigEndianText(_:radix:) ✅
UInt256.encodeBigEndianText(_:radix:uppercase:) ✅ |
Beta Was this translation helpful? Give feedback.
-
Thanks! I'll think about it. I initially decided on doing it this way because I thought it would be much easier to say "you're using the wrong method" than it would be to explain why it is slow in some situations (the overload would not be available to a function generic over Swift.FixedWidthInteger, for example). |
Beta Was this translation helpful? Give feedback.
-
I was going to use ANK in a project of mine but noticed there were no benchmarks.
So, I did some of my own and, if ok, thought I'd publish them for others:
At first I thought ANK's poor performance was due to generics but the addition and shift numbers are very close to Apple's unreleased UInt128 numbers. So, not sure why multiplication, division, and string operations took such big hits.
Note: These were using the ANKFullWidthKit numbers. I don't have any other UInt256 or higher libraries to compare against so haven't done those benchmarks yet.
Beta Was this translation helpful? Give feedback.
All reactions