Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: optimise
from_word128_ptr
by speculation (#3893)
...that the upper 64 bits of the cycle count are all zeros. Since 1T cycles is about one dollar, having 1 in the upper word will have a value more than 18M dollars. I guess that sending such amounts is rare. However doing the bignum arithmetic to construct, shift and add the upper word is costly, see https://dfinity.github.io/canister-profiling/heartbeat/Motoko_heartbeat.svg Of course the slow paths should be tested well :-) — Done by `test/run-drun/basic-cycles.mo`! --------------- TODO - [ ] We could explore an ultra-fast path too, when the whole amount is 0.
- Loading branch information