unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* aggressive-indent-mode freezes
@ 2016-02-09  7:36 Luca Ferrari
  2016-02-09 10:31 ` Alexis
  0 siblings, 1 reply; 10+ messages in thread
From: Luca Ferrari @ 2016-02-09  7:36 UTC (permalink / raw)
  To: help-gnu-emacs

Hi all,
I'm trying aggresive-indent-mode
<https://github.com/Malabarba/aggressive-indent-mode> on my emacs
24.5.1 but if I enable the mode on some source buffer quite long in
size (e.g., a php file of around 7k lines) the system becomes
unusable: each line I edit Emacs stops responding for a few seconds (I
guess to auto-indent).
I'm curious if is there anybody else using such mode with success on
large sources and if the problem could be on PHP or a specific
language.

Thanks,
Luca



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

* Re: aggressive-indent-mode freezes
  2016-02-09  7:36 aggressive-indent-mode freezes Luca Ferrari
@ 2016-02-09 10:31 ` Alexis
  2016-02-09 11:40   ` Luca Ferrari
  0 siblings, 1 reply; 10+ messages in thread
From: Alexis @ 2016-02-09 10:31 UTC (permalink / raw)
  To: Luca Ferrari; +Cc: help-gnu-emacs


Luca Ferrari <fluca1978@infinito.it> writes:

> Hi all, I'm trying aggresive-indent-mode 
> <https://github.com/Malabarba/aggressive-indent-mode> on my 
> emacs 24.5.1 but if I enable the mode on some source buffer 
> quite long in size (e.g., a php file of around 7k lines) the 
> system becomes unusable: each line I edit Emacs stops responding 
> for a few seconds (I guess to auto-indent).  I'm curious if is 
> there anybody else using such mode with success on large sources 
> and if the problem could be on PHP or a specific language.

Using 24.5.3 on an i5-2410M running Debian Jessie x86_64, i just 
tried editing a copy of org.el, which weighs in at ~24k 
lines. There was a /slight/ lag - perhaps less than half a second? 
- but certainly not enough to make editing unworkable.

What hardware and OS are you running Emacs on?


Alexis.




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

* Re: aggressive-indent-mode freezes
  2016-02-09 10:31 ` Alexis
@ 2016-02-09 11:40   ` Luca Ferrari
  2016-02-09 12:18     ` Alexis
  0 siblings, 1 reply; 10+ messages in thread
From: Luca Ferrari @ 2016-02-09 11:40 UTC (permalink / raw)
  To: Alexis; +Cc: help-gnu-emacs

On Tue, Feb 9, 2016 at 11:31 AM, Alexis <flexibeast@gmail.com> wrote:
> What hardware and OS are you running Emacs on?

I'm using 24.5.3 on ubuntu 15.10, kernel 4.2.0.16 x64 running on AMD
Athlon(tm) 64 X2 Dual Core Processor 5800+.
I've tried to run it against loaddefs.el (around 31k lines) and it
works fine, so maybe it is a problem of the language (php) it tries to
indent?
Running on a php file it takes around 3 seconds to return responsive,
even with electric indent mode disabled. I've also tried to disable
other minor modes I use like flymake, yas, hs but nothing changed.

Luca



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

* Re: aggressive-indent-mode freezes
  2016-02-09 11:40   ` Luca Ferrari
@ 2016-02-09 12:18     ` Alexis
  2016-02-10  7:13       ` Luca Ferrari
  0 siblings, 1 reply; 10+ messages in thread
From: Alexis @ 2016-02-09 12:18 UTC (permalink / raw)
  To: Luca Ferrari; +Cc: help-gnu-emacs


Luca Ferrari <fluca1978@infinito.it> writes:
 
> I've tried to run it against loaddefs.el (around 31k lines) and 
> it works fine, so maybe it is a problem of the language (php) it 
> tries to indent?  Running on a php file it takes around 3 
> seconds to return responsive, even with electric indent mode 
> disabled. I've also tried to disable other minor modes I use 
> like flymake, yas, hs but nothing changed.

Fair enough.

i don't work much with PHP, so i just downloaded the source of 
WordPress and searched for the longest file, which turned out to 
be wp-includes/class-wp-xmlrpc-server.php, with ~6.5k 
lines. Again, editing didn't result in any appreciable lag. (The 
lag was certainly less than with org.el, which is not surprising, 
given org.el is three times larger.)

Can you try running `emacs -Q`, loading aggressive-indent 
manually, and then check if you still observe the significant lag?


Alexis.



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

* Re: aggressive-indent-mode freezes
  2016-02-09 12:18     ` Alexis
@ 2016-02-10  7:13       ` Luca Ferrari
  2016-02-10  7:39         ` Alexis
  0 siblings, 1 reply; 10+ messages in thread
From: Luca Ferrari @ 2016-02-10  7:13 UTC (permalink / raw)
  To: Alexis; +Cc: help-gnu-emacs

On Tue, Feb 9, 2016 at 1:18 PM, Alexis <flexibeast@gmail.com> wrote:
> Can you try running `emacs -Q`, loading aggressive-indent manually, and then
> check if you still observe the significant lag?

While I see aggressive-mode-indent is installed I cannot load it
manually via M-x when running emacs -Q. Am I doing something wrong?

Luca



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

* Re: aggressive-indent-mode freezes
  2016-02-10  7:13       ` Luca Ferrari
@ 2016-02-10  7:39         ` Alexis
  2016-02-10 11:04           ` Luca Ferrari
  0 siblings, 1 reply; 10+ messages in thread
From: Alexis @ 2016-02-10  7:39 UTC (permalink / raw)
  To: Luca Ferrari; +Cc: help-gnu-emacs


Luca Ferrari <fluca1978@infinito.it> writes:

> On Tue, Feb 9, 2016 at 1:18 PM, Alexis <flexibeast@gmail.com> 
> wrote:
>> Can you try running `emacs -Q`, loading aggressive-indent 
>> manually, and then check if you still observe the significant 
>> lag?
>
> While I see aggressive-mode-indent is installed I cannot load it 
> manually via M-x when running emacs -Q. Am I doing something 
> wrong?

To actually load the library, you'll need to go to your *scratch* 
buffer in your emacs -Q session and do something like:

(load 
"~/.emacs.d/elpa/aggressive-indent-20160209.956/aggressive-indent-autoloads.el")

changing the 'aggressive-indent-20160209.956' part as 
necessary. You can then evaluate that code by positioning the 
cursor at the end of it (i.e. just after the closing parenthesis), 
then pressing C-x C-e.

You should then find `aggressive-indent-mode` is available via 
M-x.

(Normally the `package-initialize` function handles doing all the 
package loading stuff for you, but in this instance, we don't want 
`package-initialize` doing that, because it would load other 
packages, and we're trying to narrow down whether the problem is 
with `aggressive-indent-mode` itself, with another package, or a 
combination of both.)


Alexis.



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

* Re: aggressive-indent-mode freezes
  2016-02-10  7:39         ` Alexis
@ 2016-02-10 11:04           ` Luca Ferrari
  2016-02-10 11:29             ` Alexis
       [not found]             ` <mailman.4295.1455103755.843.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Luca Ferrari @ 2016-02-10 11:04 UTC (permalink / raw)
  To: Alexis; +Cc: help-gnu-emacs

On Wed, Feb 10, 2016 at 8:39 AM, Alexis <flexibeast@gmail.com> wrote:
> You should then find `aggressive-indent-mode` is available via M-x.
>

Done, and the php file now is indented quickly. Therefore there is
something else that is causing the problem. Now, what is the best way
to find out without having to comment out each loaded module and
iteratively try?

Thanks,
Luca



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

* Re: aggressive-indent-mode freezes
  2016-02-10 11:04           ` Luca Ferrari
@ 2016-02-10 11:29             ` Alexis
       [not found]             ` <mailman.4295.1455103755.843.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Alexis @ 2016-02-10 11:29 UTC (permalink / raw)
  To: Luca Ferrari; +Cc: help-gnu-emacs


Luca Ferrari <fluca1978@infinito.it> writes:

> Done, and the php file now is indented quickly. Therefore there 
> is something else that is causing the problem. Now, what is the 
> best way to find out without having to comment out each loaded 
> module and iteratively try?

Well, if i were in this situation, i would bisect and re-bisect my 
config file to narrow things down to the section which seems to 
cause the problem. However, my config is indeed mostly done via a 
single file, and i don't make use of things like starter kits, 
Spacemacs, etc. If you do, i'm not sure what the best approach 
might be - perhaps someone else could make some suggestions .... ?


Alexis.



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

* Re: aggressive-indent-mode freezes
       [not found]             ` <mailman.4295.1455103755.843.help-gnu-emacs@gnu.org>
@ 2016-02-10 12:03               ` Joost Kremers
  2016-02-11  5:43                 ` Alexis
  0 siblings, 1 reply; 10+ messages in thread
From: Joost Kremers @ 2016-02-10 12:03 UTC (permalink / raw)
  To: help-gnu-emacs

Alexis wrote:
>
> Luca Ferrari <fluca1978@infinito.it> writes:
>
>> Done, and the php file now is indented quickly. Therefore there 
>> is something else that is causing the problem. Now, what is the 
>> best way to find out without having to comment out each loaded 
>> module and iteratively try?
>
> Well, if i were in this situation, i would bisect and re-bisect my 
> config file to narrow things down to the section which seems to 
> cause the problem. However, my config is indeed mostly done via a 
> single file, and i don't make use of things like starter kits, 
> Spacemacs, etc. If you do, i'm not sure what the best approach 
> might be - perhaps someone else could make some suggestions .... ?

Emacs has a profiler:

(info "(elisp) Profiling")

You can use it to check in what function(s) Emacs spends the most time
while opening/editing the file in question. That usually points to a
package that is resource-intensive.


-- 
Joost Kremers                                   joostkremers@fastmail.fm
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


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

* Re: aggressive-indent-mode freezes
  2016-02-10 12:03               ` Joost Kremers
@ 2016-02-11  5:43                 ` Alexis
  0 siblings, 0 replies; 10+ messages in thread
From: Alexis @ 2016-02-11  5:43 UTC (permalink / raw)
  To: Joost Kremers; +Cc: help-gnu-emacs


Joost Kremers <joost.m.kremers@gmail.com> writes:

> Emacs has a profiler:
>
> (info "(elisp) Profiling")
>
> You can use it to check in what function(s) Emacs spends the 
> most time while opening/editing the file in question. That 
> usually points to a package that is resource-intensive.

Excellent suggestion! Thanks. :-)


Alexis.



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

end of thread, other threads:[~2016-02-11  5:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-09  7:36 aggressive-indent-mode freezes Luca Ferrari
2016-02-09 10:31 ` Alexis
2016-02-09 11:40   ` Luca Ferrari
2016-02-09 12:18     ` Alexis
2016-02-10  7:13       ` Luca Ferrari
2016-02-10  7:39         ` Alexis
2016-02-10 11:04           ` Luca Ferrari
2016-02-10 11:29             ` Alexis
     [not found]             ` <mailman.4295.1455103755.843.help-gnu-emacs@gnu.org>
2016-02-10 12:03               ` Joost Kremers
2016-02-11  5:43                 ` Alexis

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