GNU bug report logs - #12033
format should be faster

Previous Next

Package: guile;

Reported by: nalaginrut <nalaginrut <at> gmail.com>

Date: Mon, 23 Jul 2012 13:55:02 UTC

Severity: normal

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andy Wingo <wingo <at> pobox.com>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: Noah Lavine <noah.b.lavine <at> gmail.com>, 12033 <at> debbugs.gnu.org, nalaginrut <nalaginrut <at> gmail.com>
Subject: bug#12033: closed (Re: bug#12033: format should be faster)
Date: Tue, 21 Aug 2012 21:35:46 +0200
On Tue 21 Aug 2012 13:37, ludo <at> gnu.org (Ludovic Courtès) writes:

>> It seems clear that in this case, Guile "should" know how to dispatch
>> on the format string just once, outside of the loop, instead of doing
>> it in every iteration.
>
> I think Andy would say: “inline cache!”.  :-)

:-)

There are lots of possibilities here.  You could "compile" a format
string into a closure, and save it in a hash table.  You could compile
it to Scheme and then compile that procedure.  You could recognize some
common degenerate cases.

Dunno!  In this case I would compile the string into a closure.  Seems
pretty cheap and it would kill the dispatch overhead.

Andy
-- 
http://wingolog.org/




This bug report was last modified 12 years and 357 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.