regex - 从相对 URL 确定完整 URL 的最快方法是什么(给定基本 URL)

标签 regex performance perl uri perl-module

我目前正在使用模块 URI::URL从相对 URL 生成完整 URL;但是,它的运行速度并没有我希望的那么快。有谁知道另一种可能更快的方法?

最佳答案

刚刚发生在this article指出了影响 URI 的 Perl 的 Redhat/Centos/Fedora 实现中的缺点深刻地。
如果您正在运行这些 Linux 风格之一,您可能希望从原始源代码(而不是 RPM 源代码)重新编译 Perl。

I realized that anyone running perl code with the distribution perl interpretter on Redhat 5.2, Centos 5.2 or Fedora 9 is likely a victim. Yes, even if your code doesn’t use the fancy bless/overload idiom, many CPAN modules do! This google search shows 1500+ modules use the bless/overload idiom and they include some really popular ones like URI, JSON. ...

... At this point, I decided to recompile perl from source. The bug was gone. And the difference was appalling. Everything got seriously fast. CPUs were chilling at a loadavg below 0.10 and we were processing data 100x to 1000x faster!

关于regex - 从相对 URL 确定完整 URL 的最快方法是什么(给定基本 URL),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26855/

相关文章:

javascript将子字符串替换为重复次数的值

python - sre_constants.error : nothing to repeat

perl - Gitweb:如何像github一样自动以html格式显示markdown文件

javascript - RegExp 用于验证网站 URL 不适用于数组

python - 使用正则表达式增加版本号

c - 如果在 C 中为 null,检查大量数据的最快方法?

ios - 缓慢的 Swift 字符串性能

php - MySQL:查询另一个查询结果并返回两个结果?

regex - 如何在 Perl 中提取用双引号括起来的子字符串?

perl - Perl 中是否有任何别名可用于引用模块名称?