GNU bug report logs - #24012
25.0.95; forward-comment backwards takes O(n^2)

Previous Next

Package: emacs;

Reported by: Leo Liu <sdl.web <at> gmail.com>

Date: Sun, 17 Jul 2016 11:05:02 UTC

Severity: normal

Found in version 25.0.95

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Leo Liu <sdl.web <at> gmail.com>
Subject: bug#24012: closed (Re: bug#24012: 25.0.95; forward-comment
 backwards takes O(n^2))
Date: Fri, 08 Nov 2019 04:00:04 +0000
[Message part 1 (text/plain, inline)]
Your bug report

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

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 24012 <at> debbugs.gnu.org.

-- 
24012: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24012
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Stefan Kangas <stefan <at> marxist.se>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 24012-done <at> debbugs.gnu.org, Leo Liu <sdl.web <at> gmail.com>
Subject: Re: bug#24012: 25.0.95; forward-comment backwards takes O(n^2)
Date: Fri, 08 Nov 2019 04:59:14 +0100
Stefan Kangas <stefan <at> marxist.se> writes:

> Dmitry Gutov <dgutov <at> yandex.ru> writes:
>
>> On 7/17/16 2:04 PM, 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.
>>
>> FWIW, it looks fixed in the master branch now.
>>
>> Probably by 14b95587520959c5b54356547a0a69932a9bb480, so no idea what exactly
>> was causing it.
>
> Indeed.  I only see O(n) on current master -- that is, if I use the
> source code from the original report, and double the amount of lines
> by C-x h M-w C-y, the time to evaluate this expression in a buffer
> only doubles:
>
>     (progn (end-of-buffer) (forward-comment (- (point))))
>
> Leo, are you still seeing this issue?  If I don't hear back within a
> couple of weeks, I'll just assume that this has been fixed and close
> this bug.

More information was requested, but none was given within 5 weeks, so
I'm closing this bug.  If this is still an issue, please reopen the
bug report.

Best regards,
Stefan Kangas

[Message part 3 (message/rfc822, inline)]
From: Leo Liu <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.95; forward-comment backwards takes O(n^2)
Date: Sun, 17 Jul 2016 19:04:18 +0800
[Message part 4 (text/plain, inline)]
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

[tt.rb (text/plain, attachment)]

This bug report was last modified 5 years and 198 days ago.

Previous Next


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