[Top][All Lists]

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


From: Stefan Monnier
Subject: print-circle
Date: Wed, 22 Dec 2010 16:34:08 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

I've just installed a patch that makes print-circle algorithmically more
efficient by using a has-table rather than a linear table to keep track
of already seen objects.

I tested it on quail/ZIRANMA.el: with the old code compiling with
print-circle (i.e. without byte-compile-disable-print-circle:nil) would
take ages, whereas it just took a second without print-circle.  With the
new code, using print-circle slows down its compilation by about 20%.

Interestingly enough, I suspect that this 20% might come from the time
it takes to actually output the bytes, since the file is also larger with
print-circle (1865255 vs 1582898), the reason being that a lot of
sharing found by print-circle is on small strings: it takes less space
to print "自然" twice rather than to print #4535="自然" and #4535#.

I still think that these files should turn off
byte-compile-disable-print-circle (which should be marked obsolete),
since while the resulting .elc files might be a bit larger, the
in-memory data will be smaller thanks to the sharing.
Any objection to obsoleting byte-compile-disable-print-circle?


reply via email to

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