[Top][All Lists]

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

Re: Very long lines in shell-mode

From: Richard Stallman
Subject: Re: Very long lines in shell-mode
Date: Wed, 06 Dec 2006 23:59:33 -0500

    Most likely the 2MB line will be inserted in the buffer in many little
    chunks of maybe 4KB or so: for each chunk font-lock may decide to refontify
    the whole line.  Each fontification step takes time proportional to the
    length of the line, so you get O(n^2) behavior.

    And this is without even considering the regexps involved which may very
    likely add a factor of n to that.

    Maybe for such cases, font-lock should have a "sanity check" and either not
    fontify the line at all, or fontify only a part of it at a time.

A possible simple solution: in Shell mode, don't fontify a line that
doesn't end in a newline.  If that solves the problem, it would be
simple enough to install now.

reply via email to

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