From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Han-Wen Nienhuys Newsgroups: gmane.lisp.guile.devel Subject: Fast format (was Re: What can I do to help?) Date: Sun, 6 Oct 2002 13:20:43 +0200 Sender: guile-devel-admin@gnu.org Message-ID: <15776.7307.310784.558162@blauw.xs4all.nl> References: <20020928105825.A8084@ns.jfreebies.com> <20021001171420.A21559@ns.jfreebies.com> <87it0jfnrg.fsf@prodromou.san-francisco.ca.us> Reply-To: hanwen@cs.uu.nl NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1033903155 8280 127.0.0.1 (6 Oct 2002 11:19:15 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 6 Oct 2002 11:19:15 +0000 (UTC) Cc: guile-devel@gnu.org Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17y9RH-00029K-00 for ; Sun, 06 Oct 2002 13:19:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17y9RD-0005Zq-00; Sun, 06 Oct 2002 07:19:07 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17y9Qe-0004TW-00 for guile-devel@gnu.org; Sun, 06 Oct 2002 07:18:32 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17y9PL-0002e4-00 for guile-devel@gnu.org; Sun, 06 Oct 2002 07:17:15 -0400 Original-Received: from smtpzilla2.xs4all.nl ([194.109.127.138]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17y9Ou-0002Df-00 for guile-devel@gnu.org; Sun, 06 Oct 2002 07:16:44 -0400 Original-Received: from blauw.xs4all.nl (blauw.xs4all.nl [213.84.26.127]) by smtpzilla2.xs4all.nl (8.12.0/8.12.0) with ESMTP id g96BGgOj017266; Sun, 6 Oct 2002 13:16:43 +0200 (CEST) Original-To: Daniel Skarda <0rfelyus@ucw.cz> In-Reply-To: X-Mailer: VM 7.05 under Emacs 21.2.1 Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:1463 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1463 0rfelyus@ucw.cz 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 | hanwen@cs.uu.nl | http://www.cs.uu.nl/~hanwen _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel