Forum: Ruby WWW::Mechanize speed

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
narf968 (Guest)
on 2005-12-04 21:28
(Received via mailing list)
I found the Ruby version of the following script is half as fast as the
Perl version.

Here's a typical result on my computer:

$ time ./ ; time ./mech.rb

real    0m6.182s
user    0m0.284s
sys     0m0.030s

real    0m11.754s
user    0m0.566s
sys     0m0.068s

It's just frustrating, especially when you're trying to ... eh, enhance
your online game score. But seriously, what the hell?


use WWW::Mechanize;

$agent = WWW::Mechanize->new();


require 'mechanize'

agent =
leavengood (Guest)
on 2005-12-04 21:40
(Received via mailing list)
It is most likely the HTML parsing that is slowing things down. Does
the Perl version always parse the HTML, or only on demand?

Either way, REXML is not known to be the fastest thing in the world.

This topic is locked and can not be replied to.