tqchen commented on PR #783: URL: https://github.com/apache/tvm-ffi/pull/783#issuecomment-5654997014
Latest common i64 benchmark for this BigInt implementation. Nanoseconds per operation, median of seven samples; GCC 11, C++17, `-O3 -DNDEBUG`. Timed source `314467e` has the same executable implementation as final `d239d9be` (later documentation and benchmark extraction only), using rebuilt Release runtime SHA256 `b7a901a950f72c8527dea5d0fd5b198b28f47ab9d55275cf2d506228e72f4b77`. `BigInt(no-builtin)` enables `TVM_FFI_BIGINT_FORCE_PORTABLE` for scalar checked-overflow helpers. Both ratios use the same unrounded Raw i64 control. The matched runs preserve fixtures, the shared GCD algorithm and result-address/memory-clobber barrier; exact expected values were validated before timing. Each full run has 157 groups and 1,099 samples. Reported decimal precision is not a measurement-accuracy claim. | Operation | Raw i64 | BigInt | BigInt(no-builtin) | BigInt/raw | No-builtin/raw | |---|---:|---:|---:|---:|---:| | add | 0.353 | 0.977 | 1.390 | 2.771x | 3.941x | | sub | 0.353 | 1.111 | 1.387 | 3.151x | 3.933x | | mul | 0.282 | 1.497 | 2.024 | 5.308x | 7.176x | | div | 1.944 | 2.334 | 2.432 | 1.200x | 1.251x | | mod | 1.986 | 2.382 | 2.323 | 1.199x | 1.169x | | and | 0.282 | 1.036 | 1.036 | 3.670x | 3.667x | | or | 0.282 | 1.042 | 1.036 | 3.692x | 3.671x | | xor | 0.282 | 1.050 | 1.036 | 3.719x | 3.669x | | eq | 0.477 | 0.833 | 0.833 | 1.744x | 1.745x | | ne | 0.557 | 0.833 | 0.836 | 1.496x | 1.501x | | lt | 0.557 | 0.833 | 0.833 | 1.496x | 1.495x | | le | 0.475 | 0.834 | 0.833 | 1.757x | 1.754x | | gt | 0.476 | 0.834 | 0.833 | 1.752x | 1.749x | | ge | 0.557 | 0.833 | 0.833 | 1.495x | 1.495x | | truncdiv | 1.945 | 2.506 | 2.323 | 1.288x | 1.194x | | truncmod | 1.944 | 2.341 | 2.782 | 1.204x | 1.431x | | floordiv | 1.944 | 2.316 | 2.374 | 1.191x | 1.221x | | floormod | 1.946 | 2.318 | 2.507 | 1.191x | 1.288x | | min | 0.557 | 1.025 | 1.120 | 1.842x | 2.012x | | max | 0.557 | 1.025 | 1.024 | 1.841x | 1.840x | | shl | 0.284 | 2.780 | 3.063 | 9.792x | 10.787x | | shr | 0.560 | 2.363 | 2.330 | 4.217x | 4.158x | | neg | 0.560 | 0.875 | 0.870 | 1.562x | 1.553x | | not | 0.283 | 0.880 | 0.875 | 3.113x | 3.096x | | bool | 0.304 | 0.562 | 0.558 | 1.850x | 1.837x | | to_double | 0.560 | 0.561 | 0.556 | 1.000x | 0.993x | | gcd | 22.138 | 76.184 | 75.202 | 3.441x | 3.397x | | from_double | 0.313 | 0.908 | 0.908 | 2.900x | 2.900x | -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
