我最近一直想知道正则表达式实现的性能,并且很难想出很多有用的信息.
I have been wondering about the performance of regular expression implementations lately, and have had a hard time coming up with much useful information.
它很容易对浏览器/javascript regex 性能进行基准测试(网上有很多工具).Chrome 和 Opera 中的 javascript regex 实现几乎摧毁了所有其他主要浏览器.
Its easy enough to benchmark browser/javascript regex performance (plenty of tools on the net). The javascript regex implementation in Chrome and Opera pretty much destroy every other major browser.
但是当涉及到最快的 c++、java、c#、python 等..正则表达式实现时,没有太多好的基准或比较.
But when it comes down to the fastest c++, java, c#, python, etc.. regex implementation, there aren't too many good benchmarks or comparisons.
那么,具有接近完整功能实现的最快的正则表达式库是什么?(不太关心反向引用)
So, whats the fastest regex library out there with close to complete feature implementation? (not too concerned about back-references)
推荐答案虽然我自己只做过几次测试,但我相信 re2 库本来应该很快,所以我猜它是 ;)
Although I haven't done more than a couple of tests myself, I believe that the re2 library was meant to be fast so I'm guessing it is ;)
然而,为了使这更具建设性.看看这个基准:lh3lh3.users.sourceforge/reb.shtml
However, to make this a little more constructive. Take a look at this benchmark: lh3lh3.users.sourceforge/reb.shtml
更多推荐
正则表达式库基准测试
发布评论