[erlang-questions] String Pattern Matching

Richard A. O'Keefe <>
Tue Sep 9 03:17:25 CEST 2008


On 8 Sep 2008, at 9:11 pm, Hynek Vychodil wrote:
> There is much more efficient lists:reverse/2 BIF written in C.

Not relevant to the main point.
(Even in pure Erlang, it's possible to do better than the simple
code I showed.)
I wanted _all_ the relevant code to be in the message.

The key point is that the cost of the trie match is
proportional to the length of the string (times something
for choosing the right branch at each step) and not directly
related to the number of patterns.





More information about the erlang-questions mailing list