Subject: bug#23019: parse-partial-sexp doesn't output the full state needed for its continuance.

From: Alan Mackenzie <[email-masked]>
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).