unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
       [not found] ` <20200501192116.A55EE20B5B@vcs0.savannah.gnu.org>
@ 2020-05-01 21:01   ` Stefan Monnier
  2020-05-01 21:45     ` Michael Heerdegen
  2020-05-02  0:03     ` Eric Abrahamsen
  0 siblings, 2 replies; 20+ messages in thread
From: Stefan Monnier @ 2020-05-01 21:01 UTC (permalink / raw)
  To: emacs-devel; +Cc: Michael Heerdegen

>     Inhibit modification hooks when saving eieio-persistent's
>     
>     * lisp/emacs-lisp/eieio-base.el (eieio-persistent-save): Bind
>     inhibit-modification-hooks -> t.

I think this deserves an explanation (as a extensive comment explaining
why it's needed and why we think it's safe to do it here.)

Binding `inhibit-modification-hooks` is not as dangerous as binding
`inhibit-quit` but it's something we should still avoid as much
as possible.


        Stefan


> ---
>  lisp/emacs-lisp/eieio-base.el | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el
> index 2cb1f61..010a2b6 100644
> --- a/lisp/emacs-lisp/eieio-base.el
> +++ b/lisp/emacs-lisp/eieio-base.el
> @@ -473,7 +473,8 @@ instance."
>      (let* ((cfn (or file (oref this file)))
>             (default-directory (file-name-directory cfn)))
>        (cl-letf ((standard-output (current-buffer))
> -                ((oref this file)       ;FIXME: Why change it?
> +                (inhibit-modification-hooks t)
> +                ((oref this file) ;FIXME: Why change it?
>                   (if file
>                       ;; FIXME: Makes a name relative to (oref this file),
>                       ;; whereas I think it should be relative to cfn.




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

* Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
  2020-05-01 21:01   ` master c59e878: Inhibit modification hooks when saving eieio-persistent's Stefan Monnier
@ 2020-05-01 21:45     ` Michael Heerdegen
  2020-05-01 22:03       ` Stefan Monnier
  2020-05-02  0:03     ` Eric Abrahamsen
  1 sibling, 1 reply; 20+ messages in thread
From: Michael Heerdegen @ 2020-05-01 21:45 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> >     Inhibit modification hooks when saving eieio-persistent's
> >
> >     * lisp/emacs-lisp/eieio-base.el (eieio-persistent-save): Bind
> >     inhibit-modification-hooks -> t.
>
> I think this deserves an explanation (as a extensive comment explaining
> why it's needed and why we think it's safe to do it here.)

I thought this would be obvious?  The output always goes into a fresh
temp buffer the user never sees, and the goal is to speed things up.
Sure, I can add a comment, but I don't know how I can achieve the
"extensive".

Michael.



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

* Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
  2020-05-01 21:45     ` Michael Heerdegen
@ 2020-05-01 22:03       ` Stefan Monnier
  2020-05-01 22:24         ` Michael Heerdegen
  0 siblings, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2020-05-01 22:03 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: emacs-devel

> I thought this would be obvious?  The output always goes into a fresh
> temp buffer the user never sees, and the goal is to speed things up.

It's far from the only code which adds things to a temp buffer, yet we
usually don't bind that var around such code because the speed
difference is usually not significant.

What kind of speed up have you noticed?
Have you profiled it to see which change-functions slow us down (maybe
we can disable them some other way, such as by using another major mode)?

Have you tried to use `combine-change-calls`?


        Stefan




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

* Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
  2020-05-01 22:03       ` Stefan Monnier
@ 2020-05-01 22:24         ` Michael Heerdegen
  2020-05-01 22:40           ` Stefan Monnier
  0 siblings, 1 reply; 20+ messages in thread
From: Michael Heerdegen @ 2020-05-01 22:24 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> What kind of speed up have you noticed?

A factor of roughly 4.

> Have you profiled it to see which change-functions slow us down

I tried, but no, with "profiler" I only saw 80 % of time wasted
somewhere, but no samples where assigned to anything.  That's why it
took an hour until I found that change functions are the culprit.  Note
that they are typically run 10000 or 10000 times or so.

I don't want to conceal that I have on-screen.el making use of
after-change hooks - but I dunno what other people might have put
there.  Having such stuff in such a low-level operation is rather
useless, and I don't know what modes people are using are putting into
after-change hooks.

> (maybe we can disable them some other way, such as by using another
> major mode)?

Other than `fundamental-mode'?

> Have you tried to use `combine-change-calls`?

No, but that's something I can try, yes.  Actually, `object-write' would
be the better place to use this, but since `combine-change-calls` needs
to know a region, and `object-write' is agnostic about where it writes
to, this doesn't seem to be possible.  Or should I just test
`standard-output'?  I guess it doesn't make sense to call
after-change-functions for every single atomic operation of
`object-write'.

Thanks,

Michael.



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

* Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
  2020-05-01 22:24         ` Michael Heerdegen
@ 2020-05-01 22:40           ` Stefan Monnier
  2020-05-01 23:30             ` Michael Heerdegen
  2020-05-02  4:24             ` Michael Heerdegen
  0 siblings, 2 replies; 20+ messages in thread
From: Stefan Monnier @ 2020-05-01 22:40 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: emacs-devel

> I don't want to conceal that I have on-screen.el making use of
> after-change hooks - but I dunno what other people might have put
> there.

Indeed, on-screen.el adds itself *globally* to `after-change-functions`
so it's also applied to temp buffers.  Sounds like a performance bug in
`on-screen.el`.

Do you still see the performance problem if you don't enable `on-screen`?

>> Have you tried to use `combine-change-calls`?
> No, but that's something I can try, yes.  Actually, `object-write' would
> be the better place to use this,

Not necessarily: it could be too slow (because of the cost to
enter/leave `combine-change-calls`).


        Stefan




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

* Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
  2020-05-01 22:40           ` Stefan Monnier
@ 2020-05-01 23:30             ` Michael Heerdegen
  2020-05-02 13:26               ` Stefan Monnier
  2020-05-02  4:24             ` Michael Heerdegen
  1 sibling, 1 reply; 20+ messages in thread
From: Michael Heerdegen @ 2020-05-01 23:30 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Do you still see the performance problem if you don't enable
> `on-screen`?

There are other similar "culprits" as well, all are private things.
When I turn them all off, everything is good.

> Not necessarily: it could be too slow (because of the cost to
> enter/leave `combine-change-calls`).

You mean when it's called in iteration?  That makes sense.

Ok, I'll try to use it instead of `inh-mod-hooks' in
`eieio-persistent-save'.


Michael.



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

* Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
  2020-05-01 21:01   ` master c59e878: Inhibit modification hooks when saving eieio-persistent's Stefan Monnier
  2020-05-01 21:45     ` Michael Heerdegen
@ 2020-05-02  0:03     ` Eric Abrahamsen
  2020-05-02  0:22       ` Michael Heerdegen
  2020-05-02 13:32       ` Stefan Monnier
  1 sibling, 2 replies; 20+ messages in thread
From: Eric Abrahamsen @ 2020-05-02  0:03 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Michael Heerdegen, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>     Inhibit modification hooks when saving eieio-persistent's
>>     
>>     * lisp/emacs-lisp/eieio-base.el (eieio-persistent-save): Bind
>>     inhibit-modification-hooks -> t.
>
> I think this deserves an explanation (as a extensive comment explaining
> why it's needed and why we think it's safe to do it here.)
>
> Binding `inhibit-modification-hooks` is not as dangerous as binding
> `inhibit-quit` but it's something we should still avoid as much
> as possible.

I'm curious what the objection is -- why would we *want* modification
hooks to run when writing an eieio object out to file?



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

* Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
  2020-05-02  0:03     ` Eric Abrahamsen
@ 2020-05-02  0:22       ` Michael Heerdegen
  2020-05-02 13:32       ` Stefan Monnier
  1 sibling, 0 replies; 20+ messages in thread
From: Michael Heerdegen @ 2020-05-02  0:22 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: Stefan Monnier, emacs-devel

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> I'm curious what the objection is -- why would we *want* modification
> hooks to run when writing an eieio object out to file?

I guess just because the medicine is too strong?  `combine-change-calls'
works equally good for me.

Michael.



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

* Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
  2020-05-01 22:40           ` Stefan Monnier
  2020-05-01 23:30             ` Michael Heerdegen
@ 2020-05-02  4:24             ` Michael Heerdegen
  1 sibling, 0 replies; 20+ messages in thread
From: Michael Heerdegen @ 2020-05-02  4:24 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Indeed, on-screen.el adds itself *globally* to `after-change-functions`
> so it's also applied to temp buffers.  Sounds like a performance bug in
> `on-screen.el`.

Yes, it had been intentionally, but I think it's easy to avoid, so I'll
fix that.

Thanks,

Michael.



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

* Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
  2020-05-01 23:30             ` Michael Heerdegen
@ 2020-05-02 13:26               ` Stefan Monnier
  2020-05-02 21:08                 ` Michael Heerdegen
  0 siblings, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2020-05-02 13:26 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: emacs-devel

>> Do you still see the performance problem if you don't enable
>> `on-screen`?
> There are other similar "culprits" as well, all are private things.
> When I turn them all off, everything is good.

Sounds like performance problems in your "culprits", then.
`before/after-change-functions` are functions that can be called *many*
times within a single command and for this reason they have to be
careful about their performance impact.

E.g. for `on-screen`, AFAICT the after-change-function is only there to
remove the highlighting when you modify the buffer (tho, AFAICT it
doesn't seem to work in my tests, so maybe I misunderstand it).

So IIUC, your after-change-function only need to be installed in those
buffers where there is highlighting to be removed.  IOW, the hook
function should be added to the buffer when you add highlighting to it,
and then removed when you remove the highlighting.  This will also
ensure that it will only be called once per command in any given buffer.

>> Not necessarily: it could be too slow (because of the cost to
>> enter/leave `combine-change-calls`).
> You mean when it's called in iteration?  That makes sense.

Another reason is that we don't know that `object-write` is only called
in temp buffers.


        Stefan




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

* Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
  2020-05-02  0:03     ` Eric Abrahamsen
  2020-05-02  0:22       ` Michael Heerdegen
@ 2020-05-02 13:32       ` Stefan Monnier
  2020-05-02 18:18         ` Eric Abrahamsen
  1 sibling, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2020-05-02 13:32 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: Michael Heerdegen, emacs-devel

> I'm curious what the objection is -- why would we *want* modification
> hooks to run when writing an eieio object out to file?

Do you know what modification hooks are used for?
I know some uses, but not all.  So it's pretty hard to convince myself
that there really can't be any good reason why someone might want those
hooks to be run.

More importantly, `inhibit-modification-hooks` is bound here globally,
so it will affect behavior of Emacs not just in that temp buffer if some
code happens to modify other buffers during execution of this code.
That can be *anything* when you debug the code or when you run
a sufficiently interesting `object-write` method.


        Stefan




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

* Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
  2020-05-02 13:32       ` Stefan Monnier
@ 2020-05-02 18:18         ` Eric Abrahamsen
  0 siblings, 0 replies; 20+ messages in thread
From: Eric Abrahamsen @ 2020-05-02 18:18 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Michael Heerdegen, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I'm curious what the objection is -- why would we *want* modification
>> hooks to run when writing an eieio object out to file?
>
> Do you know what modification hooks are used for?

No clue! But eieio-persistent is pretty restrictive in its other
read/write processes (removing text properties, etc), so it seemed like
this would be the wrong tool to use for changing how eieio objects are
written.

> I know some uses, but not all. So it's pretty hard to convince myself
> that there really can't be any good reason why someone might want
> those hooks to be run.
>
> More importantly, `inhibit-modification-hooks` is bound here globally,
> so it will affect behavior of Emacs not just in that temp buffer if some
> code happens to modify other buffers during execution of this code.
> That can be *anything* when you debug the code or when you run
> a sufficiently interesting `object-write` method.

Yes, that's definitely a problem. Anyway, sounds like you and Michael
have found an alternate solution.



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

* Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
  2020-05-02 13:26               ` Stefan Monnier
@ 2020-05-02 21:08                 ` Michael Heerdegen
  2020-05-02 22:09                   ` Stefan Monnier
  0 siblings, 1 reply; 20+ messages in thread
From: Michael Heerdegen @ 2020-05-02 21:08 UTC (permalink / raw)
  To: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> E.g. for `on-screen`, AFAICT the after-change-function is only there to
> remove the highlighting when you modify the buffer (tho, AFAICT it
> doesn't seem to work in my tests, so maybe I misunderstand it).

Did you turn `on-screen-remove-when-edit' on (default: off)?

> So IIUC, your after-change-function only need to be installed in those
> buffers where there is highlighting to be removed.  IOW, the hook
> function should be added to the buffer when you add highlighting to it,
> and then removed when you remove the highlighting.  This will also
> ensure that it will only be called once per command in any given
> buffer.

Yes, exactly that.

> >> Not necessarily: it could be too slow (because of the cost to
> >> enter/leave `combine-change-calls`).
> > You mean when it's called in iteration?  That makes sense.
>
> Another reason is that we don't know that `object-write` is only called
> in temp buffers.

I understand that answer for `inhibit-modification-hooks', but not for
`combine-change-calls' - what is bad about combining change calls when
writing to an arbitrary buffer?

BTW, while we are on the subject, I don't understand this sentence in
the doc of the related `combine-after-change-calls' (which I don't
suggest to use):

| If BODY makes changes in the buffer, they are recorded and the
| functions on `after-change-functions' are called several times when
| BODY is finished.

Why several times - I thought this is what the thing would avoid?  And
how often is "several times"?

Thanks,

Michael.




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

* Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
  2020-05-02 21:08                 ` Michael Heerdegen
@ 2020-05-02 22:09                   ` Stefan Monnier
  2020-05-03  2:44                     ` Michael Heerdegen
  0 siblings, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2020-05-02 22:09 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: emacs-devel

>> >> Not necessarily: it could be too slow (because of the cost to
>> >> enter/leave `combine-change-calls`).
>> > You mean when it's called in iteration?  That makes sense.
>> Another reason is that we don't know that `object-write` is only called
>> in temp buffers.
> I understand that answer for `inhibit-modification-hooks', but not for
> `combine-change-calls' - what is bad about combining change calls when
> writing to an arbitrary buffer?

`combine-change-calls` is a bit less blunt, but it should still be used
with care.

For example, if you don't run the buffer modification hooks in the body,
it means that the `syntax-ppss` and `syntax-propertize` won't be
properly flushed, so if you use them interspersed with buffer
modifications you may get incorrect results.

As this is a common problem, `combine-change-calls` is careful to
preserve the `syntax-ppss-flush-cache` on `before-change-functions`, but
it shows the risk of what can happen with other change-functions.

> BTW, while we are on the subject, I don't understand this sentence in
> the doc of the related `combine-after-change-calls' (which I don't
> suggest to use):
>
> | If BODY makes changes in the buffer, they are recorded and the
> | functions on `after-change-functions' are called several times when
> | BODY is finished.
>
> Why several times - I thought this is what the thing would avoid?  And
> how often is "several times"?

I think it's as many times as there were modifications, tho I haven't
looked at this code in too many years to remember for sure.
I'm not sure why it was designed that way.


        Stefan




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

* Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
  2020-05-02 22:09                   ` Stefan Monnier
@ 2020-05-03  2:44                     ` Michael Heerdegen
  2020-05-03  4:01                       ` Stefan Monnier
  0 siblings, 1 reply; 20+ messages in thread
From: Michael Heerdegen @ 2020-05-03  2:44 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Eric Abrahamsen, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> `combine-change-calls` is a bit less blunt, but it should still be used
> with care.

After having identified the culprits in my case - all of them can be
fixed - there is not much speedup left from this particular change.
Given that, but also given that we don't know what other people might
have added there - do you think that using `combine-change-calls' in
this case is justified, Stefan?

Thanks, Michael.



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

* Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
  2020-05-03  2:44                     ` Michael Heerdegen
@ 2020-05-03  4:01                       ` Stefan Monnier
  2020-05-03  5:13                         ` Michael Heerdegen
  0 siblings, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2020-05-03  4:01 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Eric Abrahamsen, emacs-devel

>> `combine-change-calls` is a bit less blunt, but it should still be used
>> with care.
> After having identified the culprits in my case - all of them can be
> fixed - there is not much speedup left from this particular change.
> Given that, but also given that we don't know what other people might
> have added there - do you think that using `combine-change-calls' in
> this case is justified, Stefan?

I hope not ;-)


        Stefan




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

* Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
  2020-05-03  4:01                       ` Stefan Monnier
@ 2020-05-03  5:13                         ` Michael Heerdegen
  2020-05-04 21:09                           ` Eric Abrahamsen
  0 siblings, 1 reply; 20+ messages in thread
From: Michael Heerdegen @ 2020-05-03  5:13 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: Stefan Monnier, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> > After having identified the culprits in my case - all of them can be
> > fixed - there is not much speedup left from this particular change.
> > Given that, but also given that we don't know what other people might
> > have added there - do you think that using `combine-change-calls' in
> > this case is justified, Stefan?
>
> I hope not ;-)

Then Eric I think it's your turn now to check (profile) if this is at
all helpful in your case.  Could you please try that?

Thanks,

Michael.



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

* Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
  2020-05-03  5:13                         ` Michael Heerdegen
@ 2020-05-04 21:09                           ` Eric Abrahamsen
  2020-05-04 21:36                             ` Michael Heerdegen
  0 siblings, 1 reply; 20+ messages in thread
From: Eric Abrahamsen @ 2020-05-04 21:09 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Stefan Monnier, emacs-devel

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>> > After having identified the culprits in my case - all of them can be
>> > fixed - there is not much speedup left from this particular change.
>> > Given that, but also given that we don't know what other people might
>> > have added there - do you think that using `combine-change-calls' in
>> > this case is justified, Stefan?
>>
>> I hope not ;-)
>
> Then Eric I think it's your turn now to check (profile) if this is at
> all helpful in your case.  Could you please try that?

Okay, I started with the existing `inhibit-modification-hooks' edit.
Saving both the gnus registry (not many objects but they're pretty
large; file is 30M) and one of my EBDB databases (many objects but
they're quite small; file is 550K). Basically just loaded both objects
into a variable, and then repeatedly saved the object with
`eieio-persistent-save'.

;; With modification hooks uninhibited (ie, reverting Michael's commit).
(benchmark-run 100 (my-save-registry)) -> (1028.64836554 2801 537.1068782020001)
(benchmark-run 100 (my-save-ebdb)) -> (51.585404029 134 20.779424303000003)

;; With modification hooks inhibited (Emacs master).
(benchmark-run 100 (my-save-registry)) -> (989.206686569 2800 526.325465032)
(benchmark-run 100 (my-save-ebdb)) -> (63.946958194 127 23.392065172000002)

I haven't tried it with `combine-change-calls' or any of the other
speedups (gc-cons-threshold, etc), mostly because I've also been trying
to get work done. But I can test with any combination of changes, as
needed.

Eric



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

* Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
  2020-05-04 21:09                           ` Eric Abrahamsen
@ 2020-05-04 21:36                             ` Michael Heerdegen
  2020-05-04 21:42                               ` Eric Abrahamsen
  0 siblings, 1 reply; 20+ messages in thread
From: Michael Heerdegen @ 2020-05-04 21:36 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: Stefan Monnier, emacs-devel

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> ;; With modification hooks uninhibited (ie, reverting Michael's commit).
> (benchmark-run 100 (my-save-registry)) -> (1028.64836554 2801
> 537.1068782020001)
> (benchmark-run 100 (my-save-ebdb)) -> (51.585404029 134 20.779424303000003)
>
> ;; With modification hooks inhibited (Emacs master).
> (benchmark-run 100 (my-save-registry)) -> (989.206686569 2800 526.325465032)
> (benchmark-run 100 (my-save-ebdb)) -> (63.946958194 127 23.392065172000002)

`my-save-ebdb' is slower with modification hooks inhibited?

Anyway, the time differences are quite small.

Michael.



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

* Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's
  2020-05-04 21:36                             ` Michael Heerdegen
@ 2020-05-04 21:42                               ` Eric Abrahamsen
  0 siblings, 0 replies; 20+ messages in thread
From: Eric Abrahamsen @ 2020-05-04 21:42 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Stefan Monnier, emacs-devel

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> ;; With modification hooks uninhibited (ie, reverting Michael's commit).
>> (benchmark-run 100 (my-save-registry)) -> (1028.64836554 2801
>> 537.1068782020001)
>> (benchmark-run 100 (my-save-ebdb)) -> (51.585404029 134 20.779424303000003)
>>
>> ;; With modification hooks inhibited (Emacs master).
>> (benchmark-run 100 (my-save-registry)) -> (989.206686569 2800 526.325465032)
>> (benchmark-run 100 (my-save-ebdb)) -> (63.946958194 127 23.392065172000002)
>
> `my-save-ebdb' is slower with modification hooks inhibited?

That's why this took me so long, I decided I was confused and re-ran the
tests all over again.

Also I forgot to note:

My before-change-functions: (org-indent-notify-modified-headline org-before-change-function t syntax-ppss-flush-cache)

My after-change-functions: (jit-lock-after-change flyspell-after-change-function org-indent-refresh-maybe t)



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

end of thread, other threads:[~2020-05-04 21:42 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200501192115.23847.67499@vcs0.savannah.gnu.org>
     [not found] ` <20200501192116.A55EE20B5B@vcs0.savannah.gnu.org>
2020-05-01 21:01   ` master c59e878: Inhibit modification hooks when saving eieio-persistent's Stefan Monnier
2020-05-01 21:45     ` Michael Heerdegen
2020-05-01 22:03       ` Stefan Monnier
2020-05-01 22:24         ` Michael Heerdegen
2020-05-01 22:40           ` Stefan Monnier
2020-05-01 23:30             ` Michael Heerdegen
2020-05-02 13:26               ` Stefan Monnier
2020-05-02 21:08                 ` Michael Heerdegen
2020-05-02 22:09                   ` Stefan Monnier
2020-05-03  2:44                     ` Michael Heerdegen
2020-05-03  4:01                       ` Stefan Monnier
2020-05-03  5:13                         ` Michael Heerdegen
2020-05-04 21:09                           ` Eric Abrahamsen
2020-05-04 21:36                             ` Michael Heerdegen
2020-05-04 21:42                               ` Eric Abrahamsen
2020-05-02  4:24             ` Michael Heerdegen
2020-05-02  0:03     ` Eric Abrahamsen
2020-05-02  0:22       ` Michael Heerdegen
2020-05-02 13:32       ` Stefan Monnier
2020-05-02 18:18         ` Eric Abrahamsen

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).