Skip to content

Instantly share code, notes, and snippets.

@gwillem
Last active March 14, 2017 13:54
Show Gist options
  • Save gwillem/55a51dbc8460c23485950426b313e47d to your computer and use it in GitHub Desktop.
Save gwillem/55a51dbc8460c23485950426b313e47d to your computer and use it in GitHub Desktop.
Simple PHP XML benchmark

In practice this mini benchmark seems to be a good indicator of Magento performance.

# Download ~1MB XML sample file
sudo apt-get install -y php-cli php-xml time
mkdir -p ~/xmltest
cd ~/xmltest
wget http://www.cs.washington.edu/research/xmldatasets/data/mondial/mondial-3.0.xml
cat >test.php <<'EOM'
<?php
for ($x=0;$x<100;$x++) {
    $xml = simplexml_load_file('mondial-3.0.xml');
}
?>
EOM
/usr/bin/time -f %U php test.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment