• node.js 24.0.2 versus bun.js 1.2.16 (Re: Last 8 digits of fib(1000000)

    From Mild Shock@21:1/5 to anthk on Thu Jun 12 09:40:16 2025
    Hi,

    Didn't try Maxima or raw SBCL , only noticed
    that the node BigInt are pretty fast:

    /* node.js 24.0.2 */
    ?- time((between(1,10,_), fib(1000000, _X),
    Y is _X mod 10^8, fail; true)).
    % Zeit 241 ms, GC 0 ms, Lips 102352, Uhr 12.06.2025 09:34
    true.

    Unlike the bun BigInts:

    /* bun.js 1.2.16 */
    ?- time((between(1,10,_), fib(1000000, _X),
    Y is _X mod 10^8, fail; true)).
    % Zeit 3697 ms, GC 0 ms, Lips 6672, Uhr 12.06.2025 09:36
    true.

    Bye

    anthk schrieb:
    On 2025-03-18, Mild Shock <[email protected]> wrote:
    Hi,

    Not sure what a CAS would do, but this looks
    nice. Some measurement from a browser:

    ?- time((fib(1000000, _X), Y is _X mod 10^8)).
    % Zeit 28 ms, GC 0 ms, Lips 88857, Uhr 16.03.2025 22:48
    Y = 42546875

    The 28 ms execution time are not bad, since modulo
    was not integrated into matexp/3, making it to
    compute the full fibonacci(1000000) before taking

    the modulo. Not sure whether JavaScript bigint
    is faster or slower than GMP ?

    Bye

    Try Maxima or raw SBCL computing a lisp function.


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)