Liliana Marie Prikler <liliana.prik...@ist.tugraz.at> skribis: > Am Donnerstag, dem 20.10.2022 um 11:29 +0200 schrieb Ludovic Courtès: >> Logging as performed by ‘%service-file-logger’ is quite GC-intensive >> (but shouldn’t be leaky!); this bit: >> >> (let ((prefix (strftime default-logfile-date-format >> (localtime (current-time))))) >> (format output "~a~a~%" prefix line) >> (loop)) > > (let ((prefix (strftime default-logfile-date-format > (localtime (current-time))))) > (format output "~a~a~%" prefix line) > (loop)) > > Would it make a difference if you instead wrote > > (let ((prefix (strftime default-logfile-date-format > (localtime (current-time))))) > (format output "~a~a~%" prefix line)) > (loop) > > ? Semantically, they're equivalent (perhaps with a wrapping begin > needed), but the compiler might fail to see this.
I’m confident the compiler does the right thing, and it’s a tail call so ‘prefix’ doesn’t outlive one loop iteration. Ludo’.