Closed supki closed 11 years ago
This comment references this from milestone beta1: https://realworldocaml.org/beta1/en/html/lists-and-patterns.html#idp7712448
Context:
Generally, pattern matching is more efficient than the alternatives you might code by hand. One notable exception is matches over strings, which are in fact tested sequentially, and which for long lists can be outperformed by a hashtable. But most of the time, pattern matching is a clear performance win.
Blech. I meant, matches containing long sequences of string patterns will be slow, because they're tested sequentially. I clarified the language.
It's not clear what the second sentence of this paragraph tries to communicate. Where do "long lists" come into play when matching strings? How exactly these matches could be outperformed by hashtables?