Skip to content

Instantly share code, notes, and snippets.

@joecorcoran
Created September 29, 2011 07:22
Show Gist options
  • Save joecorcoran/1250175 to your computer and use it in GitHub Desktop.
Save joecorcoran/1250175 to your computer and use it in GitHub Desktop.
cities gem: YAML vs JSON
10.times { City.cities_in_country("RU") }
Benchmark.bm
------------
user system total real
JSON 33.210000 0.630000 33.840000 ( 33.872267)
YAML 78.530000 3.230000 81.760000 ( 81.758585)
Benchmark.bmbm
--------------
user system total real
JSON 30.160000 0.320000 30.480000 ( 30.418316)
YAML 67.870000 3.010000 70.880000 ( 70.767640)
@joecorcoran
Copy link
Author

JSON: parsing JSON files using Yajl::Parser
YAML: parsing YAML files using YAML#load_file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment