Browse thread
[Caml-list] Performance problem
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Matt Gushee <mgushee@h...> |
| Subject: | Re: [Caml-list] Performance problem |
On Thu, May 15, 2003 at 01:13:48AM +0300, Ville-Pertti Keinonen wrote:
>
> Regular expressions can be much slower than you might expect for
> non-trivial cases. The expression in your program looks particularly
> nasty, since there are a lot of ambiguous cases (whether '-' should
> match '.*' or '-' depends on everything that follows).
>
> You might want to try using Str.split instead.
Yes, that works well. Considering the number of times I've seen Python
gurus admonishing newbies to use simple string functions instead of
regexes whenever possible (and have probably admonished a few myself),
you'd think I would have thought of that. But all's well that ends well,
I guess.
--
Matt Gushee When a nation follows the Way,
Englewood, Colorado, USA Horses bear manure through
mgushee@havenrock.com its fields;
http://www.havenrock.com/ When a nation ignores the Way,
Horses bear soldiers through
its streets.
--Lao Tzu (Peter Merel, trans.)
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners