Re: performance patch
- Date: Wed, 18 Mar 1998 12:00:24 -0500
In message <199803172224.XAA24402@localhost>, Jan-Pieter Cornet writes:
> Curtis Villamizar wrote:
> > I hope this is the right place to send a tiny patch. In any case,
> > this minor recoding makes the syntax check go a whole lot faster.
>
> I have no idea about the right place, however, being a strict perl
> devotee, I couldn't let the following slip by:
>
> > ! foreach $tmpword ( split("\\s+", "$tmppol") ) {
>
> *horrified*. I guess you normally use TCL where such constructs are normal?
> I'd write (which makes it even faster because the regexp needn't be compiled
> every time)
>
> foreach $tmpword ( split( /\s+/, $tmppol ) ) {
>
> Sorry for the extra intrusion,
We went from almost 2 hourse to under 10 minutes and you want to
improve appearance and shave one large string copy and probably a few
milliseconds.
You guys just don't get it:
while ($tmppol=~ s/(\S+)//) {
On a very long string with a few thousand "words" this change the
length of the string a couple of thousand times. These are the kind
of things that actually make a difference.
Thanks for the practical suggestion. :-)
Curtis
|