]> Repositorios git - scryer-prolog.git/commit
switch from Integer to u128
authorSkgland <[email protected]>
Sat, 21 Mar 2026 12:36:40 +0000 (13:36 +0100)
committerSkgland <[email protected]>
Sat, 21 Mar 2026 12:36:40 +0000 (13:36 +0100)
commit8aab8873885d5e4d5681a5731d34b9c1f14cba3c
tree02df93397bbba2e550f961a5da5c7fe6df5645bb
parent79a9b950cbc64cecbd2d254cf160e2b8d5b215ff
switch from Integer to u128

- u128 is only 16 bytes instead of 24
- incrementing u128 does not involve heap allocations
- u128 should be sufficent
 it would take more than 2 sextilion years to overflow if we would be incrementing it every tick at 5GHz
   i.e. 2^128-1 / 5 GHz / 60 / 60 / 24 / 356 > 2 sextilion

before this ~3.2% of the execution time of the program in https://github.com/mthom/scryer-prolog/issues/3265#issuecomment-4103176469 was spend in the increment_call_count function, after this change it's down to 0.3%
src/machine/dispatch.rs
src/machine/machine_state.rs
src/machine/mod.rs
src/machine/system_calls.rs
src/parser/ast.rs