Beware exponential code

| No Comments

I am not discovering America, but this:

s/(\S+)$//s); $x = $1; $y = $_;

is the hell of a lot faster than an equivalent

/^(.*?)(\S+)$/); $x = $2; $y = $1;

One can really feel that with moderately long lines (50K or so).

Leave a comment

About this Entry

This page contains a single entry by tobez published on December 12, 2004 6:38 PM.

Link "longening" service is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.