Skip to content

Instantly share code, notes, and snippets.

@durran
Created August 2, 2011 16:55
Show Gist options
  • Save durran/1120647 to your computer and use it in GitHub Desktop.
Save durran/1120647 to your computer and use it in GitHub Desktop.
Mongoid Benchmarks
2.1.0-stable branch
Creating indexes...
Starting benchmark...
user system total real
[ Root Document Benchmarks ]
[ 1000 ]
#create 0.420000 0.010000 0.430000 ( 0.431558)
#each 0.040000 0.010000 0.050000 ( 0.040263)
#find 0.000000 0.000000 0.000000 ( 0.001047)
#save 0.290000 0.010000 0.300000 ( 0.308889)
#update_attribute 0.280000 0.020000 0.300000 ( 0.290908)
[ 10000 ]
#create 3.700000 0.110000 3.810000 ( 3.807870)
#each 0.340000 0.030000 0.370000 ( 0.377602)
#find 0.000000 0.000000 0.000000 ( 0.001236)
#save 2.840000 0.140000 2.980000 ( 2.984929)
#update_attribute 2.760000 0.170000 2.930000 ( 2.917639)
[ 100000 ]
#create 36.240000 1.060000 37.300000 ( 37.277960)
#each 3.630000 0.300000 3.930000 ( 3.944501)
#find 0.000000 0.000000 0.000000 ( 0.001338)
#save 39.610000 1.610000 41.220000 ( 41.242956)
#update_attribute 28.220000 1.340000 29.560000 ( 29.563469)
[ 1000000 ]
#create 360.880000 11.140000 372.020000 (371.962213)
#each 36.270000 2.800000 39.070000 ( 39.269688)
#find 0.000000 0.000000 0.000000 ( 0.001367)
#save 393.200000 16.760000 409.960000 (410.222136)
#update_attribute 281.640000 13.980000 295.620000 (295.751742)
[ Embedded 1-n Benchmarks ]
[ 1000 ]
#build 0.180000 0.000000 0.180000 ( 0.180720)
#clear 0.090000 0.000000 0.090000 ( 0.094999)
#create 0.390000 0.020000 0.410000 ( 0.410485)
#count 0.010000 0.000000 0.010000 ( 0.001062)
#delete_all 0.130000 0.000000 0.130000 ( 0.131617)
#push (batch) 0.280000 0.000000 0.280000 ( 0.288571)
#each 0.000000 0.000000 0.000000 ( 0.002435)
#find 0.010000 0.000000 0.010000 ( 0.004371)
#delete 0.000000 0.000000 0.000000 ( 0.004023)
[ 10000 ]
#build 2.010000 0.010000 2.020000 ( 2.013803)
#clear 1.060000 0.000000 1.060000 ( 1.058500)
#create 4.240000 0.150000 4.390000 ( 34.519362)
#count 0.010000 0.000000 0.010000 ( 0.010173)
#delete_all 1.400000 0.000000 1.400000 ( 1.399038)
#push (batch) 2.960000 0.010000 2.970000 ( 2.965637)
#each 0.030000 0.000000 0.030000 ( 0.024316)
#find 0.040000 0.000000 0.040000 ( 0.045501)
#delete 0.050000 0.000000 0.050000 ( 0.044522)
[ Embedded 1-1 Benchmarks ]
[ 1000 ]
#relation= 0.310000 0.010000 0.320000 ( 0.317466)
[ 10000 ]
#relation= 3.390000 0.120000 3.510000 ( 3.499153)
[ Referenced 1-n Benchmarks ]
[ 1000 ]
#build 0.130000 0.000000 0.130000 ( 0.135307)
#clear 0.040000 0.000000 0.040000 ( 0.035914)
#create 0.330000 0.010000 0.340000 ( 0.342236)
#count 0.000000 0.000000 0.000000 ( 0.001108)
#delete_all 0.050000 0.000000 0.050000 ( 0.060477)
#push (batch) 0.230000 0.000000 0.230000 ( 0.231427)
#each 0.000000 0.000000 0.000000 ( 0.000429)
#find 0.000000 0.000000 0.000000 ( 0.010446)
#delete 0.000000 0.000000 0.000000 ( 0.003876)
[ 10000 ]
#build 1.480000 0.000000 1.480000 ( 1.486712)
#clear 0.420000 0.000000 0.420000 ( 0.417887)
#create 3.520000 0.100000 3.620000 ( 3.616677)
#count 0.000000 0.000000 0.000000 ( 0.005625)
#delete_all 0.480000 0.000000 0.480000 ( 0.491332)
#push (batch) 2.580000 0.010000 2.590000 ( 2.592377)
#each 0.000000 0.000000 0.000000 ( 0.004750)
#find 0.000000 0.000000 0.000000 ( 0.218145)
#delete 0.040000 0.000000 0.040000 ( 0.039260)
[ 100000 ]
#build 15.720000 0.090000 15.810000 ( 15.797942)
#clear 3.540000 0.020000 3.560000 ( 3.558174)
#create 41.130000 1.140000 42.270000 ( 42.230720)
#count 0.000000 0.000000 0.000000 ( 0.049179)
#delete_all 4.860000 0.020000 4.880000 ( 4.921942)
#push (batch) 31.620000 0.120000 31.740000 ( 31.694724)
#each 0.050000 0.000000 0.050000 ( 0.051599)
#find 0.000000 0.000000 0.000000 ( 2.212555)
#delete 0.390000 0.000000 0.390000 ( 0.391979)
[ Referenced 1-1 Benchmarks ]
[ 1000 ]
#relation= 0.290000 0.020000 0.310000 ( 0.307686)
[ 10000 ]
#relation= 4.060000 0.180000 4.240000 ( 4.236941)
[ 100000 ]
#relation= 31.020000 1.200000 32.220000 ( 32.199451)
[ Referenced n-n Benchmarks ]
[ 1000 ]
#build 0.110000 0.000000 0.110000 ( 0.110650)
#clear 0.030000 0.000000 0.030000 ( 0.032529)
#count 0.000000 0.000000 0.000000 ( 0.000720)
#delete_all 0.010000 0.000000 0.010000 ( 0.000775)
#push (batch) 0.220000 0.000000 0.220000 ( 0.222367)
#each 0.000000 0.000000 0.000000 ( 0.000498)
#find 0.000000 0.000000 0.000000 ( 0.010343)
#delete 0.010000 0.000000 0.010000 ( 0.005862)
[ 10000 ]
#build 1.120000 0.010000 1.130000 ( 1.122184)
#clear 0.420000 0.000000 0.420000 ( 0.459854)
#count 0.000000 0.000000 0.000000 ( 0.000950)
#delete_all 0.000000 0.000000 0.000000 ( 0.000555)
#push (batch) 2.400000 0.010000 2.410000 ( 2.409022)
#each 0.000000 0.000000 0.000000 ( 0.004725)
#find 0.010000 0.000000 0.010000 ( 0.319856)
#delete 0.060000 0.000000 0.060000 ( 0.056807)
2.0.2
Creating indexes...
Starting benchmark...
user system total real
[ Root Document Benchmarks ]
[ 1000 ]
#create 0.510000 0.010000 0.520000 ( 0.519412)
#each 0.060000 0.000000 0.060000 ( 0.059792)
#find 0.000000 0.000000 0.000000 ( 0.001061)
#save 0.440000 0.020000 0.460000 ( 0.467754)
#update_attribute 0.390000 0.020000 0.410000 ( 0.405364)
[ 10000 ]
#create 4.460000 0.170000 4.630000 ( 4.625672)
#each 0.480000 0.030000 0.510000 ( 0.514749)
#find 0.000000 0.000000 0.000000 ( 0.001253)
#save 4.000000 0.150000 4.150000 ( 4.152694)
#update_attribute 3.850000 0.130000 3.980000 ( 4.011811)
[ 100000 ]
#create 43.580000 1.120000 44.700000 ( 44.667446)
#each 5.080000 0.300000 5.380000 ( 5.396930)
#find 0.000000 0.000000 0.000000 ( 0.001394)
#save 68.050000 1.710000 69.760000 ( 69.754895)
#update_attribute 39.540000 1.340000 40.880000 ( 40.896020)
[ 1000000 ]
#create 436.180000 16.810000 452.990000 (453.721008)
#each 51.950000 2.900000 54.850000 ( 55.038497)
#find 0.000000 0.000000 0.000000 ( 0.001536)
#save 674.730000 18.180000 692.910000 (692.893617)
#update_attribute 392.550000 14.800000 407.350000 (407.329630)
[ Embedded 1-n Benchmarks ]
[ 1000 ]
#build 0.230000 0.000000 0.230000 ( 0.236098)
#clear 0.110000 0.000000 0.110000 ( 0.111214)
#create 0.500000 0.020000 0.520000 ( 0.516467)
#count 0.010000 0.000000 0.010000 ( 0.000979)
#delete_all 1.490000 0.010000 1.500000 ( 1.503247)
#push (batch) 0.440000 0.010000 0.450000 ( 0.460503)
#each 0.010000 0.000000 0.010000 ( 0.003343)
#find 0.000000 0.000000 0.000000 ( 0.004518)
#delete 0.000000 0.000000 0.000000 ( 0.003524)
[ 10000 ]
#build 2.740000 0.010000 2.750000 ( 2.745827)
#clear 1.210000 0.010000 1.220000 ( 1.218930)
#create 5.230000 0.130000 5.360000 ( 30.116488)
#count 0.010000 0.000000 0.010000 ( 0.009072)
#delete_all 188.000000 0.200000 188.200000 (188.044849)
#push (batch) 4.940000 0.110000 5.050000 ( 5.043665)
#each 0.030000 0.000000 0.030000 ( 0.033737)
#find 0.050000 0.000000 0.050000 ( 0.047055)
#delete 0.040000 0.000000 0.040000 ( 0.041698)
[ Embedded 1-1 Benchmarks ]
[ 1000 ]
#relation= 0.440000 0.010000 0.450000 ( 0.450334)
[ 10000 ]
#relation= 4.230000 0.110000 4.340000 ( 4.338891)
[ Referenced 1-n Benchmarks ]
[ 1000 ]
#build 0.220000 0.000000 0.220000 ( 0.219936)
#clear 0.330000 0.020000 0.350000 ( 0.351186)
#create 0.450000 0.010000 0.460000 ( 0.457986)
#count 0.000000 0.000000 0.000000 ( 0.001216)
#delete_all 0.000000 0.000000 0.000000 ( 0.001574)
#push (batch) 0.310000 0.000000 0.310000 ( 0.315043)
#each 0.010000 0.000000 0.010000 ( 0.003228)
#find 0.000000 0.010000 0.010000 ( 0.011073)
#delete 0.000000 0.000000 0.000000 ( 0.003673)
[ 10000 ]
#build 2.460000 0.000000 2.460000 ( 2.457539)
#clear 1.800000 0.090000 1.890000 ( 1.891348)
#create 4.450000 0.110000 4.560000 ( 4.554816)
#count 0.000000 0.000000 0.000000 ( 0.005521)
#delete_all 0.010000 0.000000 0.010000 ( 0.009612)
#push (batch) 3.370000 0.020000 3.390000 ( 3.393420)
#each 0.040000 0.000000 0.040000 ( 0.034097)
#find 0.000000 0.000000 0.000000 ( 0.202221)
#delete 0.040000 0.000000 0.040000 ( 0.038276)
[ 100000 ]
#build 26.680000 0.100000 26.780000 ( 26.748971)
#clear 30.560000 0.990000 31.550000 ( 31.516069)
#create 51.900000 1.090000 52.990000 ( 52.935475)
#count 0.000000 0.000000 0.000000 ( 0.050441)
#delete_all 0.040000 0.000000 0.040000 ( 0.090887)
#push (batch) 43.340000 0.190000 43.530000 ( 43.484218)
#each 0.350000 0.000000 0.350000 ( 0.348301)
#find 0.000000 0.000000 0.000000 ( 1.922725)
#delete 0.380000 0.010000 0.390000 ( 0.388656)
[ Referenced 1-1 Benchmarks ]
[ 1000 ]
#relation= 0.380000 0.010000 0.390000 ( 0.383559)
[ 10000 ]
#relation= 3.960000 0.120000 4.080000 ( 4.078793)
[ 100000 ]
#relation= 40.090000 1.050000 41.140000 ( 41.117080)
[ Referenced n-n Benchmarks ]
[ 1000 ]
#build 0.260000 0.010000 0.270000 ( 0.265479)
#clear 0.760000 0.020000 0.780000 ( 0.786346)
#count 0.000000 0.000000 0.000000 ( 0.000823)
#delete_all 0.000000 0.000000 0.000000 ( 0.001159)
#push (batch) 1.010000 0.020000 1.030000 ( 1.033141)
#each 0.000000 0.000000 0.000000 ( 0.003384)
#find 0.000000 0.000000 0.000000 ( 1.523346)
#delete 0.010000 0.000000 0.010000 ( 0.004608)
[ 10000 ]
#build 2.660000 0.060000 2.720000 ( 2.720454)
#clear 41.980000 0.120000 42.100000 ( 42.069404)
#count 0.000000 0.000000 0.000000 ( 0.000818)
#delete_all 0.000000 0.000000 0.000000 ( 0.001389)
#push (batch) 47.640000 0.290000 47.930000 (187.156867)
#each 0.030000 0.000000 0.030000 ( 0.032734)
#find 0.030000 0.090000 0.120000 (142.309735)
#delete 0.050000 0.000000 0.050000 ( 0.045625)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment