Subject: bug#24012: 25.0.95; forward-comment backwards takes O(n^2)

From: Andreas Röhler <[email-masked]>
Date: Sun, 17 Jul 2016 15:39:17 +0200

On 17.07.2016 13:04, Leo Liu wrote:
> 1. Use the attached file as an example, open it in emacs in ruby-mode
> 2. Move point to end of buffer and eval (forward-comment (- (point)))
>
> The last step takes about 0.25 seconds on my MacBook 3 GHz Intel Core
> i7. If you double the lines of comments, the time increase by 4 folds.
>
> Any idea why forward-comment backwards is so slow?
>
> Leo
>

With last line

### @end (forward-comment (- (point)))

evaluation last expression doesn't move backward at all, returns nil

GNU Emacs 25.0.95.1 (i686-pc-linux-gnu, GTK+ Version 3.14.5) of 2016-06-12