• Simple arithmetic consumes tons of CPU and memory in SBCL

    From steve@21:1/5 to Andrew Sengul on Sun Jul 11 19:26:34 2021
    Andrew Sengul <ml@scenariotech.invalid> writes:

    Hi everyone, I've found something strange while profiling a function in
    SBCL. Said function runs a (dotimes) loop and copies elements from one
    array to another. Here is the first loop and its (time) profile:

    the math you are using conses - that is to say it uses memory. You are
    calling setf many many times, it is usually better to reduce the number
    of function calls.

    I usually use something like so...

    (fill buffer 0 :start 1 :end +max-number-count+)

    so such. replace or map-into...

    compile the function and (disassemble 'function)

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