>>28
CL-USER> (sb-profile:profile format)
; No value
CL-USER> (loop repeat 1000000 do (format nil "OP is a faggot"))
NIL
CL-USER> (sb-profile:report)
seconds | consed | calls | sec/call | name
-------------------------------------------------------------
1.183 | 472,126,240 | 1,000,191 | 0.000001 | FORMAT
-------------------------------------------------------------
1.183 | 472,126,240 | 1,000,191 | | Total
estimated total profiling overhead: 0.97 seconds
overhead estimation parameters:
3.2000003e-8s/call, 9.68e-7s total profiling, 1.24e-7s internal profiling
; No value
Besides that, PROFILE comes with its own overhead, which is quite a bit over here when we're calling it that many times.
80,016 CONS CELLS
That's not cons cells. It's bytes
allocated you retard.
CL-USER(6): (* 80,016 16)
Haha, shows you don't even know the language if you type that in.
FORMAT is incredibly complex, yet it's so well optimized that it only had to alloc ~400 bytes to print that string.
Oh, and the total allocated memory at the end is just that. That memory is being free'd by the gc shortly after it is alloced. Just like you
manually malloc and free your strings.