unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: Manuel Giraud <manuel@ledu-giraud.fr>
Cc: Eli Zaretskii <eliz@gnu.org>, 74476@debbugs.gnu.org
Subject: bug#74476: [PATCH] Explore JPEG loading without quantization
Date: Sat, 30 Nov 2024 19:55:17 +0000	[thread overview]
Message-ID: <Z0ttpVn5IpnGyqPy@faroe.holly.idiocy.org> (raw)
In-Reply-To: <878qt0bmj9.fsf@ledu-giraud.fr>

On Sat, Nov 30, 2024 at 07:32:10PM +0100, Manuel Giraud wrote:
> Alan Third <alan@idiocy.org> writes:
> 
> > Probably I could do with finding some larger images as the whole thing
> > completes in under a second even without your patch.
> 
> FYI, I have used images of 4000 by 3000 pixels.
> 
> > I've had a quick dig into lookup_rgb_color and assuming you have a
> > true colour display and there's no gamma calculation going on (I don't
> > know when that happens) it shouldn't be doing a whole lot more.
> > Perhaps it's just the extra over-head of calling a function?
> 
> It seems a bit much for just a function call.  Or maybe it is the
> init_color_table call?  Should it be done for each jpeg_load?

It's 4000x3000 function calls, so it might have an effect...

I think it should be done for each load. And I just noticed you need
to add a free_color_table call after you're done with it.

I get that it's a waste of time allocating the table on a true colour
display because it's never going to be used, but it seems to make no
performance difference here and it is still needed on other display
types.

Purely for testing purposes I tried changing the PUT_PIXEL call to
this:

    PUT_PIXEL (ximg, x, y, x_make_truecolor_pixel (FRAME_DISPLAY_INFO(f), r, g, b));

I think it might have given an improvement, but it was so slight I
can't say for sure. That obviously can't be used outside of testing,
but it lets us rule out the function call, etc.
-- 
Alan Third





  reply	other threads:[~2024-11-30 19:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-22 14:53 bug#74476: [PATCH] Explore JPEG loading without quantization Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-30 10:19 ` Eli Zaretskii
2024-11-30 11:44   ` Alan Third
2024-11-30 14:54     ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-30 15:37       ` Alan Third
2024-11-30 16:26         ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-30 17:25         ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-30 18:16           ` Alan Third
2024-11-30 18:32             ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-30 19:55               ` Alan Third [this message]
2024-11-30 18:49             ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z0ttpVn5IpnGyqPy@faroe.holly.idiocy.org \
    --to=alan@idiocy.org \
    --cc=74476@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=manuel@ledu-giraud.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).