Re:Mux – A lightweight, fast HTTP request router for Go
by jules on Monday December 05, 2016 @02:31PM
(#13108467)
That depends entirely on the regex implementation. If the implementation uses a DFA to match multiple regexes simultaneously then the performance will be as good as a trie because a DFA is more or less a trie.
[ Parent
| on HN ]
Re:Mux – A lightweight, fast HTTP request router for Go
by vanderZwan on Monday December 05, 2016 @04:06PM
(#13109574)
> That depends entirely on the regex implementation
True, and anyone who knows that Russ Cox is a core member of the Go team will have a hard time suppressing a smirk when reading this :)
Re:Mux – A lightweight, fast HTTP request router for Go
by laumars on Monday December 05, 2016 @04:28PM
(#13109816)
True. I was talking specifically about the same Regexp package as the one used in the topic project though.
I assumed that would have been obvious given the context however I apologise for not stating that in my comment and shall amend it appropriately. [edit: i can't add an amendment to my previous post now]
Re:Mux – A lightweight, fast HTTP request router for Go
by mypalmike on Monday December 05, 2016 @05:01PM
(#13110124)
True. But nowadays most regex implementations are quite good (apparently go's is not - I haven't used it).
That said, most regex performance problems are PEBKAC. Writing a fast regex is hard and requires a pretty thorough understanding of parser theory. And many who use regexes don't understand that it's critical to precompile them for performance. You don't get a fast parser when you rebuild the DFA each time you use it.
*edit: a word