emacs-devel
[Top][All Lists]
Advanced

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

Re: image-size


From: Eli Zaretskii
Subject: Re: image-size
Date: Thu, 20 Jun 2013 20:16:34 +0300

> From: Lars Magne Ingebrigtsen <address@hidden>
> Date: Thu, 20 Jun 2013 18:55:56 +0200
> 
> Here's some benchmarking.
> 
> This is via ssh, using `lookup-image':

What exactly goes "via ssh"?

> (benchmark-elapse (image-size (create-image "/tmp/0.jpg") nil))
> => 2.695448783

Where can I find this file to try that?

> The next call is a lot faster, meaning that something has been pushed to
> X already:
> 
> (benchmark-elapse (image-size (create-image "/tmp/0.jpg") nil))
> => 0.000274576

It's not pushed to X, it is cached internally by Emacs in its image
cache.

> The "fast" version is consistently fast, but not as fast as the cached
> `lookup-image' version:
> 
> (benchmark-elapse (image-size (create-image "/tmp/0.jpg") t))
> => 0.045494903

I suggest to try my suggestion, it might be fast enough.  With most
formats, finding just the size of the image is very simple, you can
see it yourself in image.c (search for "_load", which will find the
various 'load' methods).



reply via email to

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