unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#52560: Profiles don't survive roundtrips via files
@ 2021-12-16 18:11 Paul Pogonyshev
  2021-12-19 11:53 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Pogonyshev @ 2021-12-16 18:11 UTC (permalink / raw)
  To: 52560

[-- Attachment #1: Type: text/plain, Size: 830 bytes --]

Emacs 27.2, pretty sure it has existed since forever and still exists.

To reproduce:

M-x profiler-start RET RET
<do whatever for a few seconds>
M-x profiler-stop RET
M-x profiler-report RET

After expanding a few nodes under `command-execute' you should come to
something like `#<subr call-interactively>'.

Now continue:

M-: (profiler-write-profile (profiler-cpu-profile) "/tmp/buggy-elisp.prof")
RET
M-: (profiler-report-profile (profiler-read-profile
"/tmp/buggy-elisp.prof")) RET

Expand the same nodes and observe that nodes with `#<whatever>' under them
no longer match, after file-roundtrip these `#<...>' multiply like crazy.
It seems what's going on is that these things get stored as strings in the
file, and after rereading them into memory, they no longer compare as equal
by profiler calltree-building code.

Paul

[-- Attachment #2: Type: text/html, Size: 1134 bytes --]

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

* bug#52560: Profiles don't survive roundtrips via files
  2021-12-16 18:11 bug#52560: Profiles don't survive roundtrips via files Paul Pogonyshev
@ 2021-12-19 11:53 ` Lars Ingebrigtsen
       [not found]   ` <CAG7BpapCvb26jEuhPRW7yRDSZs3SnFsNeY=pazqH2jicNs9B6g@mail.gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-19 11:53 UTC (permalink / raw)
  To: Paul Pogonyshev; +Cc: 52560

Paul Pogonyshev <pogonyshev@gmail.com> writes:

> Emacs 27.2, pretty sure it has existed since forever and still exists.
>
> To reproduce:
>
> M-x profiler-start RET RET
> <do whatever for a few seconds>
> M-x profiler-stop RET
> M-x profiler-report RET
>
> After expanding a few nodes under `command-execute' you should come to
> something like `#<subr call-interactively>'.
>
> Now continue:
>
> M-: (profiler-write-profile (profiler-cpu-profile) "/tmp/buggy-elisp.prof") RET
> M-: (profiler-report-profile (profiler-read-profile "/tmp/buggy-elisp.prof")) RET
>
> Expand the same nodes and observe that nodes with `#<whatever>' under them
> no longer match, after file-roundtrip these `#<...>' multiply like crazy. 

I'm unable to reproduce this in Emacs 29 -- but then again, the profiles
report doesn't say things like #<whatever> in Emacs 29, so I may be
misunderstanding what you mean.

Could you try Emacs 28 (or 29) and see whether this problem still exists
there?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#52560: Profiles don't survive roundtrips via files
       [not found]   ` <CAG7BpapCvb26jEuhPRW7yRDSZs3SnFsNeY=pazqH2jicNs9B6g@mail.gmail.com>
@ 2021-12-22 12:30     ` Lars Ingebrigtsen
  2021-12-22 16:03       ` Paul Pogonyshev
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-22 12:30 UTC (permalink / raw)
  To: Paul Pogonyshev; +Cc: 52560

Paul Pogonyshev <pogonyshev@gmail.com> writes:

> You need any profile that involves unnamed byte-compiled functions,
> i.e. lambda in code. Also, not as leaves, they must call other
> functions, because the problem appears when merging profile backtraces
> with this, i.e. there must be several.  Maybe "default" backtrace of
> running Emacs in 28 and up doesn't include those, but I'm pretty sure
> unnamed functions could not just disappear.

When "doing whatever" includes doing a completing-read, I get some
#<compiled> things...  but after following your recipe, I'm still not
sure I understand what the problem is.  Can you include some screenshots
of the good display and the bad display?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#52560: Profiles don't survive roundtrips via files
  2021-12-22 12:30     ` Lars Ingebrigtsen
@ 2021-12-22 16:03       ` Paul Pogonyshev
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Pogonyshev @ 2021-12-22 16:03 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 52560


[-- Attachment #1.1: Type: text/plain, Size: 1395 bytes --]

On the right is the original profile, on the left it is after a round-trip
via file (save/restore). Node "#<compiled -0xd1347ae057bdde2>" is now
displayed twice, even though profile contents is supposed to be exactly the
same.

Disregard ugly fonts etc. I just started this Docker image:
https://github.com/Silex/docker-emacs/blob/master/master/debian/Dockerfile.
Version is reported as GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X
toolkit, cairo version 1.16.0, Xaw3d scroll bars)

On Wed, 22 Dec 2021 at 13:30, Lars Ingebrigtsen <larsi@gnus.org> wrote:

> Paul Pogonyshev <pogonyshev@gmail.com> writes:
>
> > You need any profile that involves unnamed byte-compiled functions,
> > i.e. lambda in code. Also, not as leaves, they must call other
> > functions, because the problem appears when merging profile backtraces
> > with this, i.e. there must be several.  Maybe "default" backtrace of
> > running Emacs in 28 and up doesn't include those, but I'm pretty sure
> > unnamed functions could not just disappear.
>
> When "doing whatever" includes doing a completing-read, I get some
> #<compiled> things...  but after following your recipe, I'm still not
> sure I understand what the problem is.  Can you include some screenshots
> of the good display and the bad display?
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no
>

[-- Attachment #1.2: Type: text/html, Size: 2055 bytes --]

[-- Attachment #2: bug-52560.png --]
[-- Type: image/png, Size: 50125 bytes --]

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

end of thread, other threads:[~2021-12-22 16:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-16 18:11 bug#52560: Profiles don't survive roundtrips via files Paul Pogonyshev
2021-12-19 11:53 ` Lars Ingebrigtsen
     [not found]   ` <CAG7BpapCvb26jEuhPRW7yRDSZs3SnFsNeY=pazqH2jicNs9B6g@mail.gmail.com>
2021-12-22 12:30     ` Lars Ingebrigtsen
2021-12-22 16:03       ` Paul Pogonyshev

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).