#!/usr/bin/perl -w use strict; use XML::Simple; use XML::LibXML; use Benchmark qw(cmpthese); my $file = shift or die "usage: $0 xmlfile\n"; my $xml = XMLin( $file); my $dom = XML::LibXML->load_xml(location => $file); cmpthese ( -1, { simple => sub { XMLout($xml) }, libxml => sub { $dom->toString() }, } ); __END__ Rate simple libxml simple 29.4/s -- -96% libxml 658/s 2141% --