I'm currently using the module URI::URL
to generate a full URL from a relative URL; however, it isn't running as fast as I'd like it to be. Does anyone know another way to do this that may be faster?
Just happened across this article which point out shortcomings in Redhat/Centos/Fedora implementations of Perl which affect URI
profoundly.
If you are running one of these Linux flavours, you might want to recompile Perl from original source (not RPM source).
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!
The following code should work.
$uri = URI->new_abs( $str, $base_uri )
You should also take a look at the URI page on search.cpan.org.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With