[Top][All Lists]

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

Re: [Emacs-diffs] comment-cache 223d16f 2/3: Apply `comment-depth' text

From: martin rudalics
Subject: Re: [Emacs-diffs] comment-cache 223d16f 2/3: Apply `comment-depth' text properties when calling `back_comment'.
Date: Sun, 13 Mar 2016 10:26:10 +0100

> OK.  Here are my timings.  Just for the record I time things with this
> macro:
>      (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)))
> , rather than with elp, which will make my times a bit less.  I've timed
> `foo' and `bar' on optimised builds in the emacs-25 branch and the
> comment-cache branch (incorporating the patch I posted earlier).  Here
> are the timings in seconds:
>                emacs-25              comment-cache
> foo            2.535                    1.651
> bar           13.685                    1.620
> These timings (apart from `bar' on emacs-25) are surely acceptable.
> There's one subtlety about the comment-cache branch: I've now renamed
> `comment-depth' (etc.) to `literal-cache' (etc.), and set
> `literal-cacheing-flag' (renamed from `comment-cacheing-flag') to t by
> default.  However, I've only just committed the corresponding required
> change to CC Mode, so this might have a bearing on your timings.
> Other than that, I can't explain what's going on with your timings.
>> (defun foofoo ()
>>     (interactive)
>>     (elp-instrument-function 'c-end-of-defun)
>>     (goto-char (point-min))
>>     (foo)
>>     (elp-results))
>> (defun foobar ()
>>     (interactive)
>>     (elp-instrument-function 'c-beginning-of-defun)
>>     (goto-char (point-max))
>>     (bar)
>>     (elp-results))
> Just for the record:
>                 emacs-25               comment-cache
> foofoo           2.545                   1.643
> foobar          13.729                   1.642

I yet don't care about comment-cache or the other fix you proposed.  I
compared the emacs-25 branch with current _master_ because here the
latter is slower by a factor of 20.  And my measurements are for builds
without optimization only.

As long as this riddle is not resolved it doesn't make much sense for me
to test minor optimizations.  Please clarify this issue.


reply via email to

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