GNU bug report logs - #23019
parse-partial-sexp doesn't output the full state needed for its continuance.

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Tue, 15 Mar 2016 09:12:01 UTC

Severity: normal

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alan Mackenzie <acm <at> muc.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 23019 <at> debbugs.gnu.org
Subject: bug#23019: parse-partial-sexp doesn't output the full state needed for its continuance.
Date: Fri, 18 Mar 2016 19:16:33 +0000
Hello, Stefan.

On Fri, Mar 18, 2016 at 12:27:36PM -0400, Stefan Monnier wrote:
> > (scan_sexps_forward): Remove a redundant state parameter.  Access all `state'
> > information via the address parameter `state'.

> Have you taken a look at the performance impact of this part of the change?
> I don't expect it will make much difference, but I'm actually wondering
> whether it makes things slower or faster.

I didn't give all that much thought to it.  With a "local" state,
state.field will be addressed as a constant offset from the stack frame
base register.  With a "remote" state, state->field will be addressed as
a constant offset from some address register.  Provided the processor
has enough registers available, it shouldn't make a difference.  But on
an architecture with a restricted set of registers (?old 80x86), it might
make things slower if an address register needs to be repeatedly loaded,
or even repeatedly stacked around function calls.

I'm going to try timing it both ways:  (parse-partial-sexp (point-min)
(point-max)) on xdisp.c (what else?):

Code with "->": 0.03793740272521973 seconds.
Code with "." : 0.03828787803649902 seconds.

So, at least on my machine, the "indirect" version is faster, by around
1%.  Not a great difference, but I'm surprised by the way it went.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 9 years and 108 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.