From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Daniel Skarda <0rfelyus@ucw.cz> Newsgroups: gmane.lisp.guile.devel Subject: Re: Fast format (was Re: What can I do to help?) Date: 06 Oct 2002 19:53:20 +0200 Sender: guile-devel-admin@gnu.org Message-ID: References: <20020928105825.A8084@ns.jfreebies.com> <20021001171420.A21559@ns.jfreebies.com> <87it0jfnrg.fsf@prodromou.san-francisco.ca.us> <15776.7307.310784.558162@blauw.xs4all.nl> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1033926995 6435 127.0.0.1 (6 Oct 2002 17:56:35 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 6 Oct 2002 17:56:35 +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 17yFdn-0001fJ-00 for ; Sun, 06 Oct 2002 19:56:32 +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 17yFcS-0004ib-00; Sun, 06 Oct 2002 13:55:08 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17yFbt-0003S8-00 for guile-devel@gnu.org; Sun, 06 Oct 2002 13:54:33 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17yFbJ-0002KA-00 for guile-devel@gnu.org; Sun, 06 Oct 2002 13:53:58 -0400 Original-Received: from stateless1.tiscali.cz ([213.235.135.70] helo=mail.tiscali.cz) by monty-python.gnu.org with esmtp (Exim 4.10) id 17yFaL-0001P5-00 for guile-devel@gnu.org; Sun, 06 Oct 2002 13:52:57 -0400 Original-Received: from hobitin.ucw.cz (212.11.98.134) by mail.tiscali.cz (6.0.044) id 3D771DDB0053BAC2; Sun, 6 Oct 2002 19:48:40 +0200 Original-Received: from 0rfelyus by hobitin.ucw.cz with local (Exim 3.36 #1 (Debian)) id 17yFaj-00008S-00; Sun, 06 Oct 2002 19:53:21 +0200 Original-To: hanwen@cs.uu.nl In-Reply-To: <15776.7307.310784.558162@blauw.xs4all.nl> Original-Lines: 24 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 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:1467 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1467 > > guile> (time (do-ntimes (n 100000) (simple-format p "~s" 3.14159265358979))) > do-ntimes ? Common-Lisp like macro dotimes (see HyperSpec). The speed of simple-format is not problem. simple-format (C implementation) is fast, the real problem is format from (ice-9 format). It is scheme format implementation (it accepts more formating parameters than simple-format does. guile> (time (do-ntimes (n 100000) (simple-format p "~s" 3.14159265358979))) Elapsed time: 1.875558 sec guile> (time (do-ntimes (n 100000) (format p "~s" 3.14159265358979))) Elapsed time: 21.257521 sec Do you see the diference? For example, if you want to pad numbers, you have to use scheme format implementation. Think in C: if you want to just print numbers ("%d") you can use "fast "implementation", if you want to write "%3d", you have to use more than 10 times slower implementation. Strange, is not it? 0. _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel