bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#36566: 27.0.50; debug is sometimes horribly slow


From: Noam Postavsky
Subject: bug#36566: 27.0.50; debug is sometimes horribly slow
Date: Sun, 18 Aug 2019 21:30:56 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux)

Gemini Lasswell <gazally@runbox.com> writes:

>>> ...by modifying the logic in print_preprocess to not create a hash table
>>> if the top-level object is a string with no properties.
>>
>> This last idea sounds like a straightforward win to me, with no obvious
>> drawbacks.  I mean, no point in allocating a hash table if we can
>> cheaply detect it will never be used, right?
>
> I made that change, and then, in studying the uses of
> print-number-table, found more cases in which allocated hash tables were
> never used.  Since 2011 when byte-compile-disable-print-circle was
> marked obsolete and 2012 when commit 4ae29f89be changed the logic in
> print_object, the only time print-number-table gets used is when
> print-circle is non-nil.

> Michael's use case is down to 0.7s on my machine.

> Subject: [PATCH 2/5] Improve performance of backtrace printing (bug#36566)
>
> * lisp/emacs-lisp/cl-print.el (cl-print-to-string-with-limit): Reduce
> print-level and print-length more quickly when the structure being
> printed is very large.

Is this one still needed?  I tried reverting it, and it seems to make no
noticeable difference now (I didn't really measure though, I can't think
of a straightforward way of doing that), at least for the case that
Michael posted.

> Subject: [PATCH 4/5] Create common tests for print.c and cl-print.el
>
> * test/lisp/emacs-lisp/cl-print-tests.el:
                                          ^
Extra colon.

> (cl-print--test, cl-print-tests-1, cl-print-tests-2)
> (cl-print-tests-3, cl-print-tests-4, cl-print-tests-5)
> (cl-print-tests-strings, cl-print-circle, cl-print-circle-2):
> Remove.

> Subject: [PATCH 5/5] Don't build print-number-table unless it will be used
>
> There are only a few users of print-number-table, and none of them use
> it when print-circle is nil.  A couple of them used to.  print_object
> was changed to not use print-number-table unless print-circle is non-nil
> in commit 4ae29f89be.  byte-compile-output-docform which uses[...]

We try not to use hashes to reference commits (e.g., so that ChangeLogs
can be read without accessing the git repo).  I prefer date+subject, as
in

    There are only a few users of print-number-table, and none of them use
    it when print-circle is nil.  A couple of them used to.  print_object
    was changed in 2012-04-20 "* src/print.c (print_preprocess): Only check
    print_depth if print-circle is nil".  byte-compile-output-docform which
    uses[...]

You can also use "Action Stamps" though I find those not so human-readable
(theoretically, it's more machine-readable).





reply via email to

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