|
Using a catalog with 226 resources and ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15], which each operation is performed 100 times for 10 runs:
|
Scenario
|
Avg Time
|
Total Time (10 runs)
|
|
PSON Parsing
|
3.628s
|
36.280s
|
|
JSON Parsing
|
0.400s
|
4.000s
|
|
PSON Generator
|
1.854s
|
18.54s
|
|
JSON Generator
|
0.377s
|
3.770s
|
JSON Parsing is 9.0 times faster than PSON Parsing and JSON Generator is 4.9 times faster than PSON Generator.
PSON Parser
$ bundle exec rake benchmark:serialization
|
Document generation not available without yard. cannot load such file -- yard
|
mkdir -p /var/folders/8m/d6146zxd6bv_3h8y4ykvvxh40000gn/T/serialization20170403-82881-1xfb2q2
|
user system total real
|
Run 1 3.530000 0.010000 3.540000 ( 3.543903)
|
Run 2 3.510000 0.000000 3.510000 ( 3.512690)
|
Run 3 3.670000 0.010000 3.680000 ( 3.684365)
|
Run 4 3.700000 0.010000 3.710000 ( 3.718385)
|
Run 5 3.630000 0.010000 3.640000 ( 3.638427)
|
Run 6 3.940000 0.010000 3.950000 ( 3.966800)
|
Run 7 3.750000 0.010000 3.760000 ( 3.764391)
|
Run 8 3.530000 0.010000 3.540000 ( 3.538834)
|
Run 9 3.520000 0.000000 3.520000 ( 3.544108)
|
Run 10 3.500000 0.010000 3.510000 ( 3.505633)
|
> total: 36.280000 0.080000 36.360000 ( 36.417534)
|
> avg: 3.628000 0.008000 3.636000 ( 3.641753)
|
JSON Parser
$ bundle exec rake benchmark:serialization
|
Document generation not available without yard. cannot load such file -- yard
|
mkdir -p /var/folders/8m/d6146zxd6bv_3h8y4ykvvxh40000gn/T/serialization20170403-83208-1a3gdnh
|
user system total real
|
Run 1 0.380000 0.020000 0.400000 ( 0.405077)
|
Run 2 0.410000 0.020000 0.430000 ( 0.425342)
|
Run 3 0.410000 0.000000 0.410000 ( 0.406045)
|
Run 4 0.400000 0.010000 0.410000 ( 0.414307)
|
Run 5 0.390000 0.010000 0.400000 ( 0.411307)
|
Run 6 0.400000 0.010000 0.410000 ( 0.407012)
|
Run 7 0.400000 0.000000 0.400000 ( 0.407509)
|
Run 8 0.410000 0.010000 0.420000 ( 0.410060)
|
Run 9 0.400000 0.020000 0.420000 ( 0.417958)
|
Run 10 0.400000 0.000000 0.400000 ( 0.410410)
|
> total: 4.000000 0.100000 4.100000 ( 4.115028)
|
> avg: 0.400000 0.010000 0.410000 ( 0.411503)
|
PSON Generator
$ bundle exec rake benchmark:serialization
|
Document generation not available without yard. cannot load such file -- yard
|
mkdir -p /var/folders/8m/d6146zxd6bv_3h8y4ykvvxh40000gn/T/serialization20170403-83810-dgiflg
|
user system total real
|
Run 1 1.860000 0.020000 1.880000 ( 1.875153)
|
Run 2 1.850000 0.000000 1.850000 ( 1.853206)
|
Run 3 1.860000 0.010000 1.870000 ( 1.861812)
|
Run 4 1.860000 0.000000 1.860000 ( 1.865498)
|
Run 5 1.860000 0.000000 1.860000 ( 1.869771)
|
Run 6 1.850000 0.010000 1.860000 ( 1.853761)
|
Run 7 1.870000 0.000000 1.870000 ( 1.878932)
|
Run 8 1.830000 0.010000 1.840000 ( 1.838582)
|
Run 9 1.860000 0.000000 1.860000 ( 1.875424)
|
Run 10 1.840000 0.010000 1.850000 ( 1.840327)
|
> total: 18.540000 0.060000 18.600000 ( 18.612467)
|
> avg: 1.854000 0.006000 1.860000 ( 1.861247)
|
JSON Generator
$ bundle exec rake benchmark:serialization
|
Document generation not available without yard. cannot load such file -- yard
|
mkdir -p /var/folders/8m/d6146zxd6bv_3h8y4ykvvxh40000gn/T/serialization20170403-84136-79p46e
|
user system total real
|
Run 1 0.380000 0.010000 0.390000 ( 0.391831)
|
Run 2 0.360000 0.010000 0.370000 ( 0.375775)
|
Run 3 0.370000 0.010000 0.380000 ( 0.382030)
|
Run 4 0.380000 0.010000 0.390000 ( 0.381708)
|
Run 5 0.370000 0.010000 0.380000 ( 0.386846)
|
Run 6 0.380000 0.010000 0.390000 ( 0.386004)
|
Run 7 0.370000 0.010000 0.380000 ( 0.384265)
|
Run 8 0.400000 0.010000 0.410000 ( 0.412926)
|
Run 9 0.380000 0.010000 0.390000 ( 0.391881)
|
Run 10 0.380000 0.010000 0.390000 ( 0.380869)
|
> total: 3.770000 0.100000 3.870000 ( 3.874136)
|
> avg: 0.377000 0.010000 0.387000 ( 0.387414)
|
|