正则表达式库基准测试

编程入门 行业动态 更新时间:2024-10-24 14:21:02
本文介绍了正则表达式库基准测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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

更多推荐

正则表达式库基准测试

本文发布于:2023-11-14 11:37:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1587113.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:基准   测试   正则表达式

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!