guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fast format (was Re: What can I do to help?)


From: Han-Wen Nienhuys
Subject: Fast format (was Re: What can I do to help?)
Date: Sun, 6 Oct 2002 13:20:43 +0200

address@hidden writes:
> Hello,
> 
>   I think Guile does not have fast formated output (see simple benchmark).
> 
>   `simple-format' now implements only basic `format' subset. I think that fast
> format could be critical for some type of applications, but simple-format does
> not even implement simple number (or string) formating.
> 
> 0.
> 
> ;--- simple (simple-)format benchmarks: -------------------------------
> 
> (use-modules (ice-9 format))
> 
> guile> (define p (open-output-file  "/dev/null"))
> 
> guile> (time (do-ntimes (n 100000) (simple-format p "~s" 3.14159265358979)))

do-ntimes ?

        guile> (gc-stats)
        ( .. (bytes-malloced . 118197) 
        guile> (simple-format p "~s" 3.14159265358979)
        guile> (gc-stats)
        (... (bytes-malloced . 118481) (gc-malloc-threshold . 204800)

each call costs 284 bytes. Multiply with 100000, and you're allocating
28 megs in miniscule chunks. The threshold is at 200k, so 16 times GC
seems reasonable - I don't really know how to speed up the GC part;
I'd guess that most time is spent in mallocing and freeing the strings
themselves.

-- 

Han-Wen Nienhuys   |   address@hidden   |   http://www.cs.uu.nl/~hanwen 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]