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
The backend currently represents weights using float32 values. Floating-point arithmetic and comparisons are significantly slower than integer operations and require the use of special floating-point registers.
OpenPowerlifting got a nice speed bump by using a fixed-point representation: a weight like 123.45 is stored as an i32 in the format 12345. Go appears to have an arbitrary-precision fixed-decimal representation through the decimal package, but a representation that hardcodes one decimal point (for i16) or two decimal points (for i32) is likely to be simpler and more performant.
The text was updated successfully, but these errors were encountered:
sstangl
added a commit
to sstangl/openweightlifting
that referenced
this issue
May 27, 2024
This patch ports the OpenPowerlifting weight representation to Go.
The new WeightKg type represents numbers like `123.45` by storing them
in a fixed-point integer representation, like `12345`. The advantage of
this representation is that integer comparisons and arithmetic are
significantly faster than the corresponding floating-point operations,
because integers do not require loads into XMM registers.
The backend currently represents weights using
float32
values. Floating-point arithmetic and comparisons are significantly slower than integer operations and require the use of special floating-point registers.OpenPowerlifting got a nice speed bump by using a fixed-point representation: a weight like
123.45
is stored as ani32
in the format12345
. Go appears to have an arbitrary-precision fixed-decimal representation through thedecimal
package, but a representation that hardcodes one decimal point (fori16
) or two decimal points (fori32
) is likely to be simpler and more performant.The text was updated successfully, but these errors were encountered: