Skip to content

Instantly share code, notes, and snippets.

@punytan
Created July 26, 2011 22:52

Revisions

  1. punytan created this gist Jul 26, 2011.
    27 changes: 27 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    $ perl benchmark/deserialize.pl
    -- deserialize
    JSON::XS: 2.3
    Data::MessagePack: 0.34
    Storable: 2.29
    Benchmark: running json, mp, storable for at least 1 CPU seconds...
    json: 1 wallclock secs ( 1.03 usr + 0.00 sys = 1.03 CPU) @ 77544.66/s (n=79871)
    mp: 1 wallclock secs ( 1.03 usr + 0.00 sys = 1.03 CPU) @ 98247.57/s (n=101195)
    storable: 1 wallclock secs ( 1.09 usr + 0.00 sys = 1.09 CPU) @ 71739.45/s (n=78196)
    Rate storable json mp
    storable 71739/s -- -7% -27%
    json 77545/s 8% -- -21%
    mp 98248/s 37% 27% --

    $ perl benchmark/serialize.pl
    -- serialize
    JSON::XS: 2.3
    Data::MessagePack: 0.34
    Storable: 2.29
    Benchmark: running json, mp, storable for at least 1 CPU seconds...
    json: 1 wallclock secs ( 1.11 usr + 0.00 sys = 1.11 CPU) @ 70446.85/s (n=78196)
    mp: 1 wallclock secs ( 1.09 usr + 0.00 sys = 1.09 CPU) @ 240499.08/s (n=262144)
    storable: 1 wallclock secs ( 1.03 usr + 0.00 sys = 1.03 CPU) @ 41754.37/s (n=43007)
    Rate storable json mp
    storable 41754/s -- -41% -83%
    json 70447/s 69% -- -71%
    mp 240499/s 476% 241% --