- Subject: Re: jed eats memory
- From: "John E. Davis" <davis@xxxxxxxxxxxxx>
- Date: Fri, 3 Aug 2007 10:28:30 -0400
=?UTF-8?Q?J=C3=B6rg?= Sommer <joerg@xxxxxxxxxxxx> wrote:
>Yes, but it needs 30 seconds to change the whole file. Is this realistic
>or can it be better? sed does the job in 2 seconds.
For extremely long lines, a forward replace algorithm such as the one
implemented by "replace" is very inefficient. In contrast, an
algorithm that uses a backward search will be much faster. Here is
such a function that should perform significantly faster in this
particular case:
define replace_backward ()
{
eob ();
while (bsearch ("\r"))
{
newline ();
del();
go_up(1);
}
}
I will look into adding a special case to the replace function to
handle operations that involve newline characters.
--John
--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.
[2007 date index]
[2007 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]