all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: 78% speed up in CC Mode scrolling.
       [not found] <20160703182957.GA4923@acm.fritz.box>
@ 2016-07-03 19:27 ` Eli Zaretskii
  2016-07-03 19:39   ` Alan Mackenzie
  2016-07-07 16:17 ` 78% speed up in CC Mode scrolling martin rudalics
  1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2016-07-03 19:27 UTC (permalink / raw
  To: Alan Mackenzie; +Cc: rudalics, johnw, emacs-devel

> Date: Sun, 3 Jul 2016 18:29:57 +0000
> From: Alan Mackenzie <acm@muc.de>
> 
> Scrolling through emacs-25's xdisp.c, I get the following timings:
>   emacs-25 branch: 45.529s
>   master branch:   25.529s
> 
> This is a speedup of around 78%.

Please show your benchmark code, and please tell which compiler
options were used to build Emacs.  Otherwise, I don't know how to
reproduce this.

> If you frequently hold down C-v or M-v, you are recommended to set
> `fast-but-imprecise-scrolling' to non-nil.

What does this recommendation have to do with the speedup?

Thanks.



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

* Re: 78% speed up in CC Mode scrolling.
  2016-07-03 19:27 ` 78% speed up in CC Mode scrolling Eli Zaretskii
@ 2016-07-03 19:39   ` Alan Mackenzie
  2016-07-05  9:27     ` Benchmarking (was: 78% speed up in CC Mode scrolling.) Nicolas Richard
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Mackenzie @ 2016-07-03 19:39 UTC (permalink / raw
  To: Eli Zaretskii; +Cc: rudalics, johnw, emacs-devel

Hello, Eli.

On Sun, Jul 03, 2016 at 10:27:54PM +0300, Eli Zaretskii wrote:
> > Date: Sun, 3 Jul 2016 18:29:57 +0000
> > From: Alan Mackenzie <acm@muc.de>

> > Scrolling through emacs-25's xdisp.c, I get the following timings:
> >   emacs-25 branch: 45.529s
> >   master branch:   25.529s

> > This is a speedup of around 78%.

> Please show your benchmark code, and please tell which compiler
> options were used to build Emacs.  Otherwise, I don't know how to
> reproduce this.

  (defmacro time-it (&rest forms)
    "Time the running of a sequence of forms using `float-time'.
  Call like this: \"M-: (time-it (foo ...) (bar ...) ...)\"."
    `(let ((start (float-time)))
      ,@forms
      (- (float-time) start)))

  (defun time-scroll (&optional arg)
    (interactive "P")
    (message "%s"
             (time-it
              (condition-case nil
                  (while t
                    (if arg (scroll-down) (scroll-up))
                    (sit-for 0))
                (error nil)))))

Do C-x C-f ..../src/xdisp.c, then without scrolling it otherwise, M-:
(time-scroll).  My measurements were done on a Linux virtual tty.

My .configure options were:

   ./configure --with-tiff=no --with-gif=no --with-gpm

.  The default values of CFLAGS, etc., were used.

> > If you frequently hold down C-v or M-v, you are recommended to set
> > `fast-but-imprecise-scrolling' to non-nil.

> What does this recommendation have to do with the speedup?

Nothing, really.  But it seemed relevant, perhaps for people running at
low levels of compiler optimisation.

> Thanks.

-- 
Alan Mackenzie (Nuremberg, Germany).



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

* Benchmarking (was: 78% speed up in CC Mode scrolling.)
  2016-07-03 19:39   ` Alan Mackenzie
@ 2016-07-05  9:27     ` Nicolas Richard
  0 siblings, 0 replies; 5+ messages in thread
From: Nicolas Richard @ 2016-07-05  9:27 UTC (permalink / raw
  To: emacs-devel

Hello,

Alan Mackenzie <acm@muc.de> writes:
>   (defmacro time-it (&rest forms)
>     "Time the running of a sequence of forms using `float-time'.
>   Call like this: \"M-: (time-it (foo ...) (bar ...) ...)\"."
>     `(let ((start (float-time)))
>       ,@forms
>       (- (float-time) start)))

FWIW there's a macro called benchmark-run for this kind of job, and
there's also an interactive version: M-x benchmark

-- 
Nicolas




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

* Re: 78% speed up in CC Mode scrolling.
       [not found] <20160703182957.GA4923@acm.fritz.box>
  2016-07-03 19:27 ` 78% speed up in CC Mode scrolling Eli Zaretskii
@ 2016-07-07 16:17 ` martin rudalics
  2016-07-07 19:20   ` Alan Mackenzie
  1 sibling, 1 reply; 5+ messages in thread
From: martin rudalics @ 2016-07-07 16:17 UTC (permalink / raw
  To: Alan Mackenzie, emacs-devel

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

 > Scrolling through emacs-25's xdisp.c, I get the following timings:
 >    emacs-25 branch: 45.529s
 >    master branch:   25.529s
 >
 > This is a speedup of around 78%.

Thank you.  Using the attached test2.el on frame.c, I get the following
results for emacs -Q (‘foofoo’ scrolls up profiling ‘foo-1’, ‘foobar’
scrolls down profiling ‘bar-1’).

emacs-25:

                Call Count  Elapsed Time  Average Time
foo-1          169         109.15699999  0.6458994082
bar-1          169         113.032       0.6688284023

master:

foo-1          169          45.28100000  0.2679349112
bar-1          169          53.406       0.3160118343

These look even better than yours (I have no idea which formula you used
to derive a speedup of "78%" though).

martin

[-- Attachment #2: test2.el --]
[-- Type: application/emacs-lisp, Size: 663 bytes --]

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

* Re: 78% speed up in CC Mode scrolling.
  2016-07-07 16:17 ` 78% speed up in CC Mode scrolling martin rudalics
@ 2016-07-07 19:20   ` Alan Mackenzie
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Mackenzie @ 2016-07-07 19:20 UTC (permalink / raw
  To: martin rudalics; +Cc: emacs-devel

Hello, Martin.

On Thu, Jul 07, 2016 at 06:17:32PM +0200, martin rudalics wrote:
>  > Scrolling through emacs-25's xdisp.c, I get the following timings:
>  >    emacs-25 branch: 45.529s
>  >    master branch:   25.529s

>  > This is a speedup of around 78%.

> Thank you.  Using the attached test2.el on frame.c, I get the following
> results for emacs -Q (‘foofoo’ scrolls up profiling ‘foo-1’, ‘foobar’
> scrolls down profiling ‘bar-1’).

> emacs-25:

>                 Call Count  Elapsed Time  Average Time
> foo-1          169         109.15699999  0.6458994082
> bar-1          169         113.032       0.6688284023

> master:

> foo-1          169          45.28100000  0.2679349112
> bar-1          169          53.406       0.3160118343

> These look even better than yours (I have no idea which formula you used
> to derive a speedup of "78%" though).

Simply 45.529 / 25.529 = 1.78.

In your timings I see a speed increase of 141% and 112% respectively.
It'd be nice if your results were more typical than mine.

What is pure coincidence (I hope) is how similar the digits in my two
timings were.

> martin

-- 
Alan Mackenzie (Nuremberg, Germany).



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

end of thread, other threads:[~2016-07-07 19:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20160703182957.GA4923@acm.fritz.box>
2016-07-03 19:27 ` 78% speed up in CC Mode scrolling Eli Zaretskii
2016-07-03 19:39   ` Alan Mackenzie
2016-07-05  9:27     ` Benchmarking (was: 78% speed up in CC Mode scrolling.) Nicolas Richard
2016-07-07 16:17 ` 78% speed up in CC Mode scrolling martin rudalics
2016-07-07 19:20   ` Alan Mackenzie

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.