browserslist-useragent icon indicating copy to clipboard operation
browserslist-useragent copied to clipboard

Add createUAMatcher to reuse configured browserslist

Open ZauberNerd opened this issue 5 years ago • 2 comments

We were using matchUA inside an express.js middleware and found that it was quite expensive to create the browserslist for every request.

This changes introduces a new export createUAMatcher that can be used to return an already configured matchUA function for a given browserslist.

This improves performance when checking multiple user-agent strings against the same browserslist.

Co-authored-by: Robin Drexler [email protected]

ZauberNerd avatar Nov 08 '18 23:11 ZauberNerd

@pastelsky have you had a chance to look over this yet? What are your thoughts?

ZauberNerd avatar Nov 30 '18 12:11 ZauberNerd

@ZauberNerd It would be great if you can share the results of the performance analysis that was done.

pastelsky avatar Dec 15 '18 03:12 pastelsky