正则表达式库基准测试 [英] Regular expression library benchmarks

查看:44
本文介绍了正则表达式库基准测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近一直想知道正则表达式实现的性能,并且很难想出很多有用的信息.

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 ;)

然而,为了使这更具建设性.看看这个基准:http://lh3lh3.users.sourceforge.net/reb.shtml

However, to make this a little more constructive. Take a look at this benchmark: http://lh3lh3.users.sourceforge.net/reb.shtml

这篇关于正则表达式库基准测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆