From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@sunsite.dk
Subject: Re: replacement slowdown
Date: Sat, 23 Apr 2005 17:12:06 +0000 [thread overview]
Message-ID: <1050423171206.ZM5141@candle.brasslantern.com> (raw)
In-Reply-To: <20050423162635.GA30862@scowler.net>
On Apr 23, 12:26pm, Clint Adams wrote:
}
} > What's calling pattryrefs() 28000+ times? Is that how many lines there
} > are in /tmp/blah?
}
} 231 lines, but 57093 chars. pattrylen() seems to be called 57092 times
} by igetmatch.
OK, that makes sense. igetmatch() has a for() loop that, when asked to
find every possible match within the string (e.g. by ${...//...}), calls
the pattern comparison once at every possible matching position. Since
the pattern is only one character long (/,/), it calls it once for each
character in the string.
But pattry() recomputes the unmetafied length of the *entire* string on
each call. So that length computation is going to have to be factored
out of pattry(), possibly by storing it in the Patprog the way that's
done for set_pat_start() and set_pat_end().
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
next prev parent reply other threads:[~2005-04-23 17:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-22 23:23 Clint Adams
2005-04-23 3:14 ` Bart Schaefer
2005-04-23 3:19 ` Clint Adams
2005-04-23 16:07 ` Bart Schaefer
2005-04-23 16:26 ` Clint Adams
2005-04-23 17:12 ` Bart Schaefer [this message]
2005-04-24 0:33 ` Peter Stephenson
2005-04-24 0:47 ` PATCH: " Bart Schaefer
2005-04-24 3:32 ` Bart Schaefer
2005-04-24 16:46 ` Bart Schaefer
2005-04-23 16:25 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1050423171206.ZM5141@candle.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
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 NNTP newsgroup(s).