News for hackers. Stuff that matters.
Re:Node.js in Flame Graphs by mjs on Wednesday November 19, 2014 @12:59PM (#8631504)
It looks like routes are either strings (exact match) or regular expression objects. I don't think there's a way to combine regular expressions in JavaScript.

I don't think this was an unreasonable implementation. Sure, it could be optimized, but no-one needed it enough to do the work. (Even Netflix didn't need a faster matcher, they needed a matcher that didn't slow down between the 1st match and the nth.)

Re:Node.js in Flame Graphs by andrewvc on Wednesday November 19, 2014 @01:04PM (#8631542)
What I'm saying is that the pipe (or) "|" is a cheap way to combine regexps. It has its limitations, but its better than an O(n) search through an array. The regexp parser can create an NFA that is far more optimized.
Re:Node.js in Flame Graphs by spion on Wednesday November 19, 2014 @05:00PM (#8632919)
In JS, "far more" isn't quite that dramatically far as in other dynamic language runtimes. See http://jsperf.com/regex-list-vs-full