You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason, even just element-wise copying an array of FixedDecimal{Int128, 2} into another array, allocates like crazy. (14,000,000 allocations / 1,000,000 elements).
Where do these allocations come from?
/ and * of FixedDecimal{Int64, 2} are more expensive than for FixedDecimal{Int32, 2}., by a factor of around 1.5x each, whereas / and * for Int64 and Int32 are almost identical.
My current guess is that this might be related to promoting to Int128 during those operations (due to widemul), which seems to be slower than Int64 across the board.
/ for Int128 is like 6x slower than for Int32! Where does that come from?
Splitting out the benchmark discussion from #36.
Here's the benchmark in a gist:
https://gist.github.com/NHDaly/a8fae0d1d65ab1066c585c27e54146fa
And the results in a google spreadsheet:
https://docs.google.com/spreadsheets/d/1Lc3ughgwwK25cpwbnuLRxw19EtaMxdCsMmtnspT_4H8/edit?usp=sharing
Here are the results:
Here are my current question:
FixedDecimal{Int128, 2}into another array, allocates like crazy. (14,000,000 allocations / 1,000,000 elements)./and*ofFixedDecimal{Int64, 2}are more expensive than forFixedDecimal{Int32, 2}., by a factor of around 1.5x each, whereas/and*forInt64andInt32are almost identical.Int128during those operations (due towidemul), which seems to be slower thanInt64across the board./forInt128is like 6x slower than forInt32! Where does that come from?