unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* print-circle
@ 2010-12-22 21:34 Stefan Monnier
  2010-12-23  7:07 ` print-circle Helmut Eller
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2010-12-22 21:34 UTC (permalink / raw)
  To: emacs-devel

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?


        Stefan



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: print-circle
  2010-12-22 21:34 print-circle Stefan Monnier
@ 2010-12-23  7:07 ` Helmut Eller
  2010-12-23 14:24   ` print-circle Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Helmut Eller @ 2010-12-23  7:07 UTC (permalink / raw)
  To: emacs-devel

* Stefan Monnier [2010-12-22 21:34] writes:

> 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?

Is the sharing computed per top-level form or for the entire file?

Helmut





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: print-circle
  2010-12-23  7:07 ` print-circle Helmut Eller
@ 2010-12-23 14:24   ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2010-12-23 14:24 UTC (permalink / raw)
  To: Helmut Eller; +Cc: emacs-devel

>> 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?
> Is the sharing computed per top-level form or for the entire file?

A mix of the two, and is not related to my patch, which only changes the
algorithmic performance of the code.


        Stefan



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-12-23 14:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-22 21:34 print-circle Stefan Monnier
2010-12-23  7:07 ` print-circle Helmut Eller
2010-12-23 14:24   ` print-circle Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).