Subject: bug#78739: 30.1; Performance issue with inline image in an org file

From: laladrik <[email-masked]>
Date: Mon, 07 Jul 2025 16:28:59 +0000

Hello,

It's been a while since the last update.  Let me bring some.

> I think it would be an important data point, yes.

I compiled Emacs with libpng 1.6.12.  Emacs still lags.

> You probably need to build debug version of Emacs with no optimizations,
> etc. -g does not save you from the code that has been optimized away by
> the compiler

Also, I tried built Emacs with CFLAGS="-g -O0", but the perf report has the
same data.  I still can't believe that I get the full information about the
execution.  Do you have any other inputs about profiling Emacs by any chance?

Best regards,
Aleksei Markov

On Sat, Jun 21, 2025 at 10:09:17AM +0300, Eli Zaretskii wrote:
> > Date: Fri, 20 Jun 2025 19:08:51 +0000
> > From: laladrik <[email-masked]>
> > Cc: [email-masked], [email-masked]
> >
> > > You probably need to build debug version of Emacs with no optimizations,
> > > etc. -g does not save you from the code that has been optimized away by
> > > the compiler
> >
> > Doesn't Emacs has some code which is enabled when it's compiled without
> > optimization?  Some additional checks or asserts.  Won't it affect the
> > performance enough to show a false picture?
>
> That's the --enable-checking option to the configure script.  It's
> independent of optimizations, so you could use it even for an
> optimized build.
>
> However, the --enable-checking option is for the cases where we have c
> rashes and other fatal errors.  It is not very useful for debugging
> performance problems.
>
> > > FWIW, I was unable to reproduce even when I disabled the use of native
> > > image API (which forces Emacs to use libpng).
> >
> > How do I switch between native image API and non-native?  Should I compile it
> > with the flag --with-native-image-api?
>
> Yes.  Or invoke Emacs with
>
>   --eval "(setq-default w32-use-native-image-API nil)"
>
> But this is only available on MS-Windows, I think.
>
> > > Could this be something that depends on the version of libpng?  I have 1.6.12
> > > here.
> >
> > Mine is 1.6.46.  Would it help to check Emacs with your version?  I guess I can
> > compile everything from the source.
>
> I think it would be an important data point, yes.
>
> > A little off-topic.  Who should I send the messages to and who should I add to
> > "Cc" when I want my message to be seen by both of you?
>
> What you did in the message to which I'm replying is okay: reply to
> one of us and have the bug number and the rest of the people CC'ed.