Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
743 lines (696 sloc) 57.1 KB
Most tests are run on a 2.16Ghz Core2Duo iMac.
Asterisk (*) indicates test run on 2.0Ghz Core2Duo MacBook.
Baseline: Revision 104.
user system total real
ActiveRecord:id 0.090000 0.020000 0.110000 ( 0.192854)
DataMapper:id 0.110000 0.000000 0.110000 ( 0.105890)
ActiveRecord:conditions 0.100000 0.020000 0.120000 ( 0.235058)
DataMapper:conditions 0.230000 0.030000 0.260000 ( 0.376210)
ActiveRecord:insert 6.090000 0.360000 6.450000 ( 7.080386)
DataMapper:insert 1.320000 0.160000 1.480000 ( 1.845571)
ActiveRecord:update 0.520000 0.080000 0.600000 ( 0.849492)
DataMapper:update 0.240000 0.030000 0.270000 ( 0.394252)
ActiveRecord:associations:lazy 3.860000 0.410000 4.270000 ( 7.057705)
ActiveRecord:associations:included 4.140000 0.030000 4.170000 ( 4.757380)
DataMapper:associations 0.600000 0.030000 0.630000 ( 0.742609)
Revision 106: Merged DataMapper::Session and DataMapper::Loader since the separation of
responsibilities wasn't all that clear, and the combination results in fewer
objects being instantiated to execute a finder. No noticeable impact on performance.
user system total real
ActiveRecord:id 0.100000 0.020000 0.120000 ( 0.192765)
DataMapper:id 0.100000 0.000000 0.100000 ( 0.101425)
ActiveRecord:conditions 0.100000 0.020000 0.120000 ( 0.233634)
DataMapper:conditions 0.220000 0.030000 0.250000 ( 0.376636)
ActiveRecord:insert 6.090000 0.370000 6.460000 ( 7.129772)
DataMapper:insert 1.310000 0.160000 1.470000 ( 1.847603)
ActiveRecord:update 0.520000 0.080000 0.600000 ( 0.856744)
DataMapper:update 0.250000 0.030000 0.280000 ( 0.396352)
ActiveRecord:associations:lazy 3.830000 0.410000 4.240000 ( 7.007074)
ActiveRecord:associations:included 4.130000 0.030000 4.160000 ( 4.729850)
DataMapper:associations 0.590000 0.030000 0.620000 ( 0.737687)
WeakHash based IdentityMap:
user system total real
ActiveRecord:id 0.120000 0.020000 0.140000 ( 0.228198)
DataMapper:id 0.370000 0.030000 0.400000 ( 0.490674)
ActiveRecord:all 0.180000 0.020000 0.200000 ( 0.339700)
DataMapper:all 1.680000 0.030000 1.710000 ( 1.858939)
ActiveRecord:conditions 0.110000 0.020000 0.130000 ( 0.266388)
DataMapper:conditions:short 0.390000 0.030000 0.420000 ( 0.555940)
DataMapper:conditions:long 0.390000 0.030000 0.420000 ( 0.555121)
ActiveRecord:insert 8.790000 0.390000 9.180000 ( 10.044282)
DataMapper:insert 2.020000 0.140000 2.160000 ( 2.614329)
ActiveRecord:update 0.720000 0.090000 0.810000 ( 1.125279)
DataMapper:update 0.550000 0.040000 0.590000 ( 0.827818)
ActiveRecord:associations:lazy 5.910000 0.460000 6.370000 ( 9.811961)
ActiveRecord:associations:included 7.200000 0.040000 7.240000 ( 7.937999)
DataMapper:associations 13.740000 0.120000 13.860000 ( 14.489632)
Hash based IdentityMap:
sam-wieck-com:~/Desktop/datamapper/trunk sam$ HASH=1 rake perf
user system total real
ActiveRecord:id 0.120000 0.020000 0.140000 ( 0.228911)
DataMapper:id 0.380000 0.020000 0.400000 ( 0.494686)
ActiveRecord:all 0.190000 0.020000 0.210000 ( 0.340205)
DataMapper:all 1.690000 0.040000 1.730000 ( 1.867063)
ActiveRecord:conditions 0.110000 0.020000 0.130000 ( 0.267131)
DataMapper:conditions:short 0.390000 0.020000 0.410000 ( 0.557804)
DataMapper:conditions:long 0.390000 0.030000 0.420000 ( 0.558492)
ActiveRecord:insert 8.790000 0.390000 9.180000 ( 10.050892)
DataMapper:insert 2.040000 0.140000 2.180000 ( 2.632233)
ActiveRecord:update 0.720000 0.090000 0.810000 ( 1.127465)
DataMapper:update 0.550000 0.040000 0.590000 ( 0.837932)
ActiveRecord:associations:lazy 5.910000 0.460000 6.370000 ( 9.826964)
ActiveRecord:associations:included 7.200000 0.030000 7.230000 ( 7.924813)
DataMapper:associations 13.750000 0.120000 13.870000 ( 14.492598)
DataMapper::Base#key tweak (and logging calls added):
user system total real
ActiveRecord:id 0.120000 0.020000 0.140000 ( 0.228172)
DataMapper:id 0.370000 0.020000 0.390000 ( 0.486401)
ActiveRecord:all 0.180000 0.030000 0.210000 ( 0.339840)
DataMapper:all 1.420000 0.030000 1.450000 ( 1.598266)
ActiveRecord:conditions 0.120000 0.020000 0.140000 ( 0.267802)
DataMapper:conditions:short 0.380000 0.030000 0.410000 ( 0.559920)
DataMapper:conditions:long 0.380000 0.030000 0.410000 ( 0.561586)
ActiveRecord:insert 8.800000 0.400000 9.200000 ( 10.079014)
DataMapper:insert 2.020000 0.130000 2.150000 ( 2.618894)
ActiveRecord:update 0.730000 0.100000 0.830000 ( 1.132801)
DataMapper:update 0.540000 0.040000 0.580000 ( 0.822116)
ActiveRecord:associations:lazy 5.910000 0.450000 6.360000 ( 9.815017)
ActiveRecord:associations:included 7.130000 0.040000 7.170000 ( 7.868133)
DataMapper:associations 12.550000 0.110000 12.660000 ( 13.287851)
DataMapper::Adapters::Sql::Coersion explicit methods and DataMapper::Adapters::Sql::Mappings::Column#type_cast_value dynamic declaration:
user system total real
ActiveRecord:id 0.110000 0.020000 0.130000 ( 0.225506)
DataMapper:id 0.370000 0.020000 0.390000 ( 0.486096)
ActiveRecord:all 0.180000 0.030000 0.210000 ( 0.339339)
DataMapper:all 1.390000 0.030000 1.420000 ( 1.573873)
ActiveRecord:conditions 0.110000 0.020000 0.130000 ( 0.264462)
DataMapper:conditions:short 0.380000 0.030000 0.410000 ( 0.550503)
DataMapper:conditions:long 0.380000 0.030000 0.410000 ( 0.552697)
ActiveRecord:insert 8.860000 0.400000 9.260000 ( 10.133664)
DataMapper:insert 2.010000 0.140000 2.150000 ( 2.617136)
ActiveRecord:update 0.720000 0.090000 0.810000 ( 1.133349)
DataMapper:update 0.540000 0.040000 0.580000 ( 0.822566)
ActiveRecord:associations:lazy 5.900000 0.460000 6.360000 ( 9.792504)
ActiveRecord:associations:included 7.140000 0.040000 7.180000 ( 7.881259)
DataMapper:associations 12.660000 0.120000 12.780000 ( 13.409695)
DataMapper::Adapters::MysqlAdapter::LoadCommand#fetch_all optimizations:
user system total real
ActiveRecord:id 0.110000 0.020000 0.130000 ( 0.225694)
DataMapper:id 0.370000 0.020000 0.390000 ( 0.487414)
ActiveRecord:all 0.180000 0.030000 0.210000 ( 0.340290)
DataMapper:all 1.270000 0.030000 1.300000 ( 1.443360)
ActiveRecord:conditions 0.100000 0.020000 0.120000 ( 0.262927)
DataMapper:conditions:short 0.390000 0.030000 0.420000 ( 0.550606)
DataMapper:conditions:long 0.390000 0.030000 0.420000 ( 0.555613)
ActiveRecord:insert 8.850000 0.400000 9.250000 ( 10.127422)
DataMapper:insert 2.000000 0.150000 2.150000 ( 2.601586)
ActiveRecord:update 0.720000 0.090000 0.810000 ( 1.130260)
DataMapper:update 0.550000 0.040000 0.590000 ( 0.822809)
ActiveRecord:associations:lazy 5.890000 0.460000 6.350000 ( 9.766891)
ActiveRecord:associations:included 7.160000 0.040000 7.200000 ( 7.904619)
DataMapper:associations 10.720000 0.130000 10.850000 ( 11.467452)
DataMapper::IdentityMap is Hash based now:
user system total real
ActiveRecord:id 0.100000 0.020000 0.120000 ( 0.220881)
DataMapper:id 0.180000 0.020000 0.200000 ( 0.299763)
ActiveRecord:all 0.230000 0.020000 0.250000 ( 0.384269)
DataMapper:all 0.650000 0.020000 0.670000 ( 0.809388)
ActiveRecord:conditions 0.100000 0.020000 0.120000 ( 0.256216)
DataMapper:conditions:short 0.190000 0.020000 0.210000 ( 0.349827)
DataMapper:conditions:long 0.180000 0.020000 0.200000 ( 0.339805)
ActiveRecord:insert 5.940000 0.390000 6.330000 ( 7.180603)
DataMapper:insert 0.930000 0.100000 1.030000 ( 1.482736)
ActiveRecord:update 0.540000 0.080000 0.620000 ( 0.932296)
DataMapper:update 0.310000 0.040000 0.350000 ( 0.582662)
ActiveRecord:associations:lazy 4.300000 0.450000 4.750000 ( 8.165738)
ActiveRecord:associations:included 4.540000 0.040000 4.580000 ( 5.266950)
DataMapper:associations 5.190000 0.080000 5.270000 ( 5.854497)
DataMapper::Adapters::Sql::Coersion#type_cast_integer modified to use String#to_i instead of Integer():
user system total real
ActiveRecord:id 0.110000 0.020000 0.130000 ( 0.221287)
DataMapper:id 0.180000 0.020000 0.200000 ( 0.300231)
ActiveRecord:all 0.220000 0.020000 0.240000 ( 0.380518)
DataMapper:all 0.640000 0.020000 0.660000 ( 0.796262)
ActiveRecord:conditions 0.100000 0.020000 0.120000 ( 0.254120)
DataMapper:conditions:short 0.180000 0.020000 0.200000 ( 0.345947)
DataMapper:conditions:long 0.180000 0.020000 0.200000 ( 0.337786)
ActiveRecord:insert 5.940000 0.390000 6.330000 ( 7.172553)
DataMapper:insert 0.920000 0.100000 1.020000 ( 1.468706)
ActiveRecord:update 0.530000 0.080000 0.610000 ( 0.926679)
DataMapper:update 0.310000 0.040000 0.350000 ( 0.583789)
ActiveRecord:associations:lazy 4.230000 0.460000 4.690000 ( 8.100321)
ActiveRecord:associations:included 4.480000 0.030000 4.510000 ( 5.209363)
DataMapper:associations 5.180000 0.080000 5.260000 ( 5.834756)
DataMapper::Adapters::Sql::Commands::Conditions#empty? optimized:
user system total real
ActiveRecord:id 0.100000 0.020000 0.120000 ( 0.218253)
DataMapper:id 0.180000 0.020000 0.200000 ( 0.300902)
ActiveRecord:all 0.220000 0.020000 0.240000 ( 0.380154)
DataMapper:all 0.630000 0.020000 0.650000 ( 0.789240)
ActiveRecord:conditions 0.100000 0.020000 0.120000 ( 0.258471)
DataMapper:conditions:short 0.190000 0.020000 0.210000 ( 0.349333)
DataMapper:conditions:long 0.180000 0.020000 0.200000 ( 0.334961)
ActiveRecord:insert 5.920000 0.380000 6.300000 ( 7.159693)
DataMapper:insert 0.920000 0.100000 1.020000 ( 1.465180)
ActiveRecord:update 0.540000 0.080000 0.620000 ( 0.934276)
DataMapper:update 0.310000 0.040000 0.350000 ( 0.584914)
ActiveRecord:associations:lazy 4.240000 0.440000 4.680000 ( 8.138604)
ActiveRecord:associations:included 4.640000 0.030000 4.670000 ( 5.362673)
DataMapper:associations 5.180000 0.080000 5.260000 ( 5.835963)
String#blank? optimized to use Regexp:
user system total real
ActiveRecord:id 0.110000 0.020000 0.130000 ( 0.218745)
DataMapper:id 0.190000 0.020000 0.210000 ( 0.302953)
ActiveRecord:all 0.220000 0.020000 0.240000 ( 0.379534)
DataMapper:all 0.640000 0.020000 0.660000 ( 0.800096)
ActiveRecord:conditions 0.100000 0.020000 0.120000 ( 0.255913)
DataMapper:conditions:short 0.190000 0.020000 0.210000 ( 0.345159)
DataMapper:conditions:long 0.170000 0.020000 0.190000 ( 0.332575)
ActiveRecord:insert 5.920000 0.380000 6.300000 ( 7.154397)
DataMapper:insert 0.930000 0.100000 1.030000 ( 1.482023)
ActiveRecord:update 0.530000 0.080000 0.610000 ( 0.932545)
DataMapper:update 0.300000 0.040000 0.340000 ( 0.585066)
ActiveRecord:associations:lazy 4.200000 0.450000 4.650000 ( 8.066527)
ActiveRecord:associations:included 4.650000 0.030000 4.680000 ( 5.368602)
DataMapper:associations 5.090000 0.080000 5.170000 ( 5.742339)
* MysqlAdapter::Commands::LoadCommand#fetch_all (original):
user system total real
ActiveRecord:id 0.120000 0.030000 0.150000 ( 0.258177)
DataMapper:id 0.210000 0.030000 0.240000 ( 0.356305)
ActiveRecord:all 0.260000 0.050000 0.310000 ( 0.472395)
DataMapper:all 0.840000 0.050000 0.890000 ( 1.039711)
ActiveRecord:conditions 0.120000 0.030000 0.150000 ( 0.299543)
DataMapper:conditions:short 0.220000 0.030000 0.250000 ( 0.407216)
DataMapper:conditions:long 0.210000 0.030000 0.240000 ( 0.394301)
ActiveRecord:insert 6.780000 0.440000 7.220000 ( 8.422043)
DataMapper:insert 1.000000 0.110000 1.110000 ( 1.641364)
ActiveRecord:update 0.600000 0.110000 0.710000 ( 1.029808)
DataMapper:update 0.350000 0.050000 0.400000 ( 0.672673)
ActiveRecord:associations:lazy 4.820000 0.760000 5.580000 ( 9.459462)
ActiveRecord:associations:included 4.920000 0.090000 5.010000 ( 5.721876)
DataMapper:associations 6.720000 0.220000 6.940000 ( 7.578226)
* MysqlAdapter::Commands::LoadCommand#fetch_all (optimized):
user system total real
ActiveRecord:id 0.120000 0.030000 0.150000 ( 0.260296)
DataMapper:id 0.220000 0.030000 0.250000 ( 0.363559)
ActiveRecord:all 0.260000 0.050000 0.310000 ( 0.474199)
DataMapper:all 0.700000 0.050000 0.750000 ( 0.898856)
ActiveRecord:conditions 0.120000 0.030000 0.150000 ( 0.300398)
DataMapper:conditions:short 0.210000 0.030000 0.240000 ( 0.405056)
DataMapper:conditions:long 0.210000 0.030000 0.240000 ( 0.392633)
ActiveRecord:insert 6.750000 0.450000 7.200000 ( 8.427758)
DataMapper:insert 0.990000 0.110000 1.100000 ( 1.641301)
ActiveRecord:update 0.590000 0.110000 0.700000 ( 1.033978)
DataMapper:update 0.350000 0.050000 0.400000 ( 0.676097)
ActiveRecord:associations:lazy 4.810000 0.770000 5.580000 ( 9.459126)
ActiveRecord:associations:included 4.950000 0.090000 5.040000 ( 5.758935)
DataMapper:associations 6.320000 0.220000 6.540000 ( 7.172041)
Repeat on iMac:
user system total real
ActiveRecord:id 0.100000 0.020000 0.120000 ( 0.219094)
DataMapper:id 0.190000 0.020000 0.210000 ( 0.303379)
ActiveRecord:all 0.220000 0.020000 0.240000 ( 0.380277)
DataMapper:all 0.630000 0.020000 0.650000 ( 0.796209)
ActiveRecord:conditions 0.100000 0.020000 0.120000 ( 0.258002)
DataMapper:conditions:short 0.180000 0.020000 0.200000 ( 0.348820)
DataMapper:conditions:long 0.170000 0.020000 0.190000 ( 0.337768)
ActiveRecord:insert 5.930000 0.390000 6.320000 ( 7.180595)
DataMapper:insert 0.930000 0.090000 1.020000 ( 1.480698)
ActiveRecord:update 0.530000 0.090000 0.620000 ( 0.931558)
DataMapper:update 0.310000 0.040000 0.350000 ( 0.583486)
ActiveRecord:associations:lazy 4.190000 0.450000 4.640000 ( 8.058710)
ActiveRecord:associations:included 4.530000 0.030000 4.560000 ( 5.260562)
DataMapper:associations 5.820000 0.070000 5.890000 ( 6.480988)
Current performance:
user system total real
ActiveRecord:id 0.110000 0.020000 0.130000 ( 0.218224)
DataMapper:id 0.180000 0.020000 0.200000 ( 0.299119)
DataMapper:id:in-session 0.060000 0.000000 0.060000 ( 0.058262)
ActiveRecord:all 0.230000 0.020000 0.250000 ( 0.380154)
DataMapper:all 0.660000 0.020000 0.680000 ( 0.811355)
DataMapper:all:in-session 0.540000 0.030000 0.570000 ( 0.700819)
ActiveRecord:conditions 0.100000 0.020000 0.120000 ( 0.262222)
DataMapper:conditions:short 0.200000 0.020000 0.220000 ( 0.356098)
DataMapper:conditions:short:in-session 0.170000 0.020000 0.190000 ( 0.332662)
DataMapper:conditions:long 0.200000 0.020000 0.220000 ( 0.355016)
DataMapper:conditions:long:in-session 0.170000 0.020000 0.190000 ( 0.330220)
ActiveRecord:insert 5.260000 0.340000 5.600000 ( 6.514014)
DataMapper:insert 0.960000 0.100000 1.060000 ( 1.528213)
ActiveRecord:update 0.530000 0.080000 0.610000 ( 0.930696)
DataMapper:update 0.390000 0.040000 0.430000 ( 0.668540)
ActiveRecord:associations:lazy 4.170000 0.450000 4.620000 ( 7.936800)
ActiveRecord:associations:included 4.580000 0.030000 4.610000 ( 5.271687)
DataMapper:associations 3.360000 0.050000 3.410000 ( 3.766838)
DataMapper:associations:in-session 0.750000 0.020000 0.770000 ( 0.906840)
ActiveRecord:find_by_sql 0.220000 0.010000 0.230000 ( 0.373307)
DataMapper:find_by_sql 0.140000 0.030000 0.170000 ( 0.302143)
Remove block-conditions support:
user system total real
ActiveRecord:id 0.100000 0.020000 0.120000 ( 0.221170)
DataMapper:id 0.190000 0.020000 0.210000 ( 0.302617)
DataMapper:id:in-session 0.050000 0.000000 0.050000 ( 0.057694)
ActiveRecord:all 0.220000 0.020000 0.240000 ( 0.377332)
DataMapper:all 0.650000 0.020000 0.670000 ( 0.811892)
DataMapper:all:in-session 0.560000 0.020000 0.580000 ( 0.716009)
ActiveRecord:conditions 0.110000 0.020000 0.130000 ( 0.263317)
DataMapper:conditions:short 0.190000 0.020000 0.210000 ( 0.350601)
DataMapper:conditions:short:in-session 0.170000 0.020000 0.190000 ( 0.331199)
DataMapper:conditions:long 0.190000 0.020000 0.210000 ( 0.352986)
DataMapper:conditions:long:in-session 0.170000 0.020000 0.190000 ( 0.331603)
ActiveRecord:insert 5.240000 0.340000 5.580000 ( 6.472757)
DataMapper:insert 0.970000 0.100000 1.070000 ( 1.577412)
ActiveRecord:update 0.550000 0.080000 0.630000 ( 0.942404)
DataMapper:update 0.400000 0.040000 0.440000 ( 0.667777)
ActiveRecord:associations:lazy 4.170000 0.450000 4.620000 ( 7.976589)
ActiveRecord:associations:included 4.650000 0.040000 4.690000 ( 5.385883)
DataMapper:associations 3.380000 0.040000 3.420000 ( 3.807896)
DataMapper:associations:in-session 0.750000 0.020000 0.770000 ( 0.903133)
ActiveRecord:find_by_sql 0.220000 0.020000 0.240000 ( 0.374365)
DataMapper:find_by_sql 0.140000 0.020000 0.160000 ( 0.300868)
Include TEXT fields in INSERT tests:
user system total real
ActiveRecord:id 0.100000 0.020000 0.120000 ( 0.200504)
DataMapper:id 0.180000 0.020000 0.200000 ( 0.276477)
DataMapper:id:in-session 0.060000 0.000000 0.060000 ( 0.058879)
ActiveRecord:all 0.210000 0.020000 0.230000 ( 0.349249)
DataMapper:all 0.610000 0.020000 0.630000 ( 0.744081)
DataMapper:all:in-session 0.500000 0.020000 0.520000 ( 0.642338)
ActiveRecord:conditions 0.100000 0.020000 0.120000 ( 0.245654)
DataMapper:conditions:short 0.190000 0.020000 0.210000 ( 0.328919)
DataMapper:conditions:short:in-session 0.160000 0.030000 0.190000 ( 0.307284)
DataMapper:conditions:long 0.190000 0.020000 0.210000 ( 0.331199)
DataMapper:conditions:long:in-session 0.160000 0.020000 0.180000 ( 0.309451)
ActiveRecord:insert 5.090000 0.330000 5.420000 ( 6.099532)
DataMapper:insert 0.960000 0.100000 1.060000 ( 1.468360)
ActiveRecord:update 0.510000 0.080000 0.590000 ( 0.847741)
DataMapper:update 0.380000 0.040000 0.420000 ( 0.618621)
ActiveRecord:associations:lazy 4.000000 0.440000 4.440000 ( 7.420747)
ActiveRecord:associations:included 4.230000 0.030000 4.260000 ( 4.865744)
DataMapper:associations 3.110000 0.040000 3.150000 ( 3.474378)
DataMapper:associations:in-session 0.690000 0.020000 0.710000 ( 0.830177)
ActiveRecord:find_by_sql 0.200000 0.020000 0.220000 ( 0.341861)
DataMapper:find_by_sql 0.140000 0.020000 0.160000 ( 0.279707)
Add tests for field accessor performance:
user system total real
ActiveRecord:id 0.120000 0.020000 0.140000 ( 0.295290)
DataMapper:id 0.200000 0.030000 0.230000 ( 0.383191)
DataMapper:id:in-session 0.060000 0.000000 0.060000 ( 0.060037)
ActiveRecord:all 0.240000 0.020000 0.260000 ( 0.489402)
DataMapper:all 0.670000 0.030000 0.700000 ( 0.936084)
DataMapper:all:in-session 0.570000 0.030000 0.600000 ( 0.820874)
ActiveRecord:conditions 0.120000 0.020000 0.140000 ( 0.370018)
DataMapper:conditions:short 0.220000 0.020000 0.240000 ( 0.471751)
DataMapper:conditions:short:in-session 0.190000 0.020000 0.210000 ( 0.455203)
DataMapper:conditions:long 0.220000 0.020000 0.240000 ( 0.471703)
DataMapper:conditions:long:in-session 0.200000 0.030000 0.230000 ( 0.448747)
ActiveRecord:insert 11.000000 0.540000 11.540000 ( 13.441723)
DataMapper:insert 1.320000 0.120000 1.440000 ( 2.240316)
ActiveRecord:update 0.640000 0.100000 0.740000 ( 1.297961)
DataMapper:update 0.440000 0.050000 0.490000 ( 0.881541)
ActiveRecord:associations:lazy 4.720000 0.530000 5.250000 ( 10.508575)
ActiveRecord:associations:included 4.660000 0.050000 4.710000 ( 5.551303)
DataMapper:associations 3.430000 0.060000 3.490000 ( 4.073533)
DataMapper:associations:in-session 0.770000 0.030000 0.800000 ( 1.035620)
ActiveRecord:find_by_sql 0.240000 0.020000 0.260000 ( 0.480992)
DataMapper:find_by_sql 0.180000 0.030000 0.210000 ( 0.435872)
ActiveRecord:accessors 0.020000 0.000000 0.020000 ( 0.014591)
DataMapper:accessors 0.010000 0.000000 0.010000 ( 0.008828)
* Major Command refactoring:
user system total real
ActiveRecord:id 0.130000 0.030000 0.160000 ( 0.266751)
DataMapper:id 0.300000 0.030000 0.330000 ( 0.446141)
DataMapper:id:in-session 0.070000 0.000000 0.070000 ( 0.069422)
ActiveRecord:all 0.280000 0.050000 0.330000 ( 0.487828)
DataMapper:all 0.860000 0.050000 0.910000 ( 1.073502)
DataMapper:all:in-session 0.840000 0.050000 0.890000 ( 1.187414)
ActiveRecord:conditions 0.120000 0.040000 0.160000 ( 0.314645)
DataMapper:conditions:short 0.310000 0.030000 0.340000 ( 0.499834)
DataMapper:conditions:short:in-session 0.280000 0.020000 0.300000 ( 0.472508)
DataMapper:conditions:long 0.300000 0.030000 0.330000 ( 0.500534)
DataMapper:conditions:long:in-session 0.280000 0.030000 0.310000 ( 0.472286)
ActiveRecord:insert 12.450000 0.530000 12.980000 ( 13.945422)
DataMapper:insert 1.640000 0.120000 1.760000 ( 2.341762)
ActiveRecord:update 0.610000 0.100000 0.710000 ( 1.061672)
DataMapper:update 0.830000 0.090000 0.920000 ( 1.334947)
ActiveRecord:associations:lazy 5.030000 0.780000 5.810000 ( 9.969720)
ActiveRecord:associations:included 5.220000 0.120000 5.340000 ( 6.182199)
DataMapper:associations 4.230000 0.140000 4.370000 ( 4.837089)
DataMapper:associations:in-session 0.940000 0.060000 1.000000 ( 1.161469)
ActiveRecord:find_by_sql 0.270000 0.050000 0.320000 ( 0.487242)
DataMapper:find_by_sql 0.300000 0.060000 0.360000 ( 0.513722)
ActiveRecord:accessors 0.010000 0.000000 0.010000 ( 0.015118)
DataMapper:accessors 0.010000 0.000000 0.010000 ( 0.008976)
* UnitOfWork refactoring:
user system total real
ActiveRecord:id 0.130000 0.030000 0.160000 ( 0.271429)
DataMapper:id 0.310000 0.030000 0.340000 ( 0.445740)
DataMapper:id:in-session 0.070000 0.000000 0.070000 ( 0.069947)
ActiveRecord:all 0.280000 0.050000 0.330000 ( 0.490220)
DataMapper:all 0.870000 0.050000 0.920000 ( 1.074154)
DataMapper:all:in-session 0.700000 0.050000 0.750000 ( 0.904959)
ActiveRecord:conditions 0.120000 0.030000 0.150000 ( 0.313456)
DataMapper:conditions:short 0.330000 0.030000 0.360000 ( 0.538847)
DataMapper:conditions:short:in-session 0.280000 0.030000 0.310000 ( 0.478948)
DataMapper:conditions:long 0.310000 0.030000 0.340000 ( 0.508575)
DataMapper:conditions:long:in-session 0.280000 0.030000 0.310000 ( 0.493394)
ActiveRecord:insert 12.580000 0.560000 13.140000 ( 14.652010)
DataMapper:insert 1.600000 0.110000 1.710000 ( 2.293812)
ActiveRecord:update 0.600000 0.100000 0.700000 ( 1.051941)
DataMapper:update 0.830000 0.080000 0.910000 ( 1.323192)
ActiveRecord:associations:lazy 5.020000 0.770000 5.790000 ( 9.850605)
ActiveRecord:associations:included 5.260000 0.100000 5.360000 ( 6.100674)
DataMapper:associations 4.210000 0.140000 4.350000 ( 4.762663)
DataMapper:associations:in-session 0.930000 0.060000 0.990000 ( 1.146315)
ActiveRecord:find_by_sql 0.270000 0.050000 0.320000 ( 0.496243)
DataMapper:find_by_sql 0.300000 0.050000 0.350000 ( 0.518110)
ActiveRecord:accessors 0.010000 0.000000 0.010000 ( 0.015175)
DataMapper:accessors 0.010000 0.000000 0.010000 ( 0.009117)
* DataObject::Mysql:
user system total real
DataMapper:id 0.350000 0.040000 0.390000 ( 0.505825)
DataMapper:id:in-session 0.060000 0.000000 0.060000 ( 0.068158)
DataMapper:all 1.490000 0.050000 1.540000 ( 1.712837)
DataMapper:all:in-session 1.290000 0.050000 1.340000 ( 1.498406)
DataMapper:conditions:short 0.340000 0.030000 0.370000 ( 0.532813)
DataMapper:conditions:short:in-session 0.310000 0.030000 0.340000 ( 0.503475)
DataMapper:conditions:long 0.340000 0.030000 0.370000 ( 0.531182)
DataMapper:conditions:long:in-session 0.310000 0.030000 0.340000 ( 0.502040)
DataMapper:insert 1.550000 0.110000 1.660000 ( 2.249506)
DataMapper:update 0.450000 0.040000 0.490000 ( 0.641661)
DataMapper:associations 5.610000 0.140000 5.750000 ( 6.165153)
DataMapper:associations:in-session 1.370000 0.050000 1.420000 ( 1.583806)
DataMapper:find_by_sql 0.770000 0.060000 0.830000 ( 0.990141)
DataMapper:accessors 0.000000 0.000000 0.000000 ( 0.008986)
* DataObject branch:
user system total real
ActiveRecord:id 0.110000 0.020000 0.130000 ( 0.231399)
DataMapper:id 0.320000 0.020000 0.340000 ( 0.531620)
DataMapper:id:in-session 0.050000 0.000000 0.050000 ( 0.060701)
ActiveRecord:all 0.220000 0.020000 0.240000 ( 0.380837)
DataMapper:all 1.370000 0.030000 1.400000 ( 1.546245)
DataMapper:all:in-session 1.150000 0.020000 1.170000 ( 1.318366)
ActiveRecord:conditions 0.110000 0.020000 0.130000 ( 0.269084)
DataMapper:conditions:short 0.300000 0.020000 0.320000 ( 0.474894)
DataMapper:conditions:short:in-session 0.280000 0.030000 0.310000 ( 0.449529)
DataMapper:conditions:long 0.310000 0.020000 0.330000 ( 0.471048)
DataMapper:conditions:long:in-session 0.290000 0.020000 0.310000 ( 0.451029)
ActiveRecord:insert 10.320000 0.460000 10.780000 ( 12.027767)
DataMapper:insert 1.600000 0.100000 1.700000 ( 2.188750)
ActiveRecord:update 0.520000 0.090000 0.610000 ( 0.929980)
DataMapper:update 0.340000 0.020000 0.360000 ( 0.509320)
ActiveRecord:associations:lazy 4.470000 0.480000 4.950000 ( 8.550955)
ActiveRecord:associations:included 4.870000 0.040000 4.910000 ( 5.681657)
DataMapper:associations 5.250000 0.070000 5.320000 ( 5.822158)
DataMapper:associations:in-session 1.290000 0.020000 1.310000 ( 1.500369)
ActiveRecord:find_by_sql 0.240000 0.020000 0.260000 ( 0.411237)
DataMapper:find_by_sql 12.400000 0.100000 12.500000 ( 12.717913)
ActiveRecord:accessors 0.020000 0.000000 0.020000 ( 0.014664)
DataMapper:accessors 0.010000 0.000000 0.010000 ( 0.008668)
* Force AR to type-cast "name" columns:
user system total real
ActiveRecord:id 0.110000 0.020000 0.130000 ( 0.234244)
DataMapper:id 0.320000 0.020000 0.340000 ( 0.443778)
DataMapper:id:in-session 0.060000 0.000000 0.060000 ( 0.060680)
ActiveRecord:all 0.240000 0.020000 0.260000 ( 0.404353)
DataMapper:all 1.410000 0.030000 1.440000 ( 1.624809)
DataMapper:all:in-session 1.190000 0.030000 1.220000 ( 1.457031)
ActiveRecord:conditions 0.120000 0.020000 0.140000 ( 0.307603)
DataMapper:conditions:short 0.310000 0.020000 0.330000 ( 0.476872)
DataMapper:conditions:short:in-session 0.290000 0.020000 0.310000 ( 0.445322)
DataMapper:conditions:long 0.300000 0.020000 0.320000 ( 0.465469)
DataMapper:conditions:long:in-session 0.280000 0.020000 0.300000 ( 0.443403)
ActiveRecord:insert 10.330000 0.460000 10.790000 ( 11.786461)
DataMapper:insert 1.610000 0.100000 1.710000 ( 2.202136)
ActiveRecord:update 0.520000 0.080000 0.600000 ( 0.928137)
DataMapper:update 0.350000 0.030000 0.380000 ( 0.518928)
ActiveRecord:associations:lazy 4.490000 0.480000 4.970000 ( 8.587722)
ActiveRecord:associations:included 4.830000 0.040000 4.870000 ( 5.618826)
DataMapper:associations 5.220000 0.050000 5.270000 ( 5.687679)
DataMapper:associations:in-session 1.310000 0.030000 1.340000 ( 1.494329)
ActiveRecord:find_by_sql 0.300000 0.020000 0.320000 ( 0.473478)
DataMapper:find_by_sql 12.410000 0.100000 12.510000 ( 12.712320)
ActiveRecord:accessors 0.020000 0.000000 0.020000 ( 0.015308)
DataMapper:accessors 0.010000 0.000000 0.010000 ( 0.008280)
Columns stored in SortedSet:
user system total real
ActiveRecord:id 0.100000 0.020000 0.120000 ( 0.202696)
DataMapper:id 0.310000 0.020000 0.330000 ( 0.412840)
DataMapper:id:in-session 0.050000 0.000000 0.050000 ( 0.057129)
ActiveRecord:all 0.230000 0.010000 0.240000 ( 0.363915)
DataMapper:all 1.300000 0.020000 1.320000 ( 1.454792)
DataMapper:all:in-session 1.080000 0.020000 1.100000 ( 1.231742)
ActiveRecord:conditions 0.100000 0.020000 0.120000 ( 0.248121)
DataMapper:conditions:short 0.300000 0.020000 0.320000 ( 0.449827)
DataMapper:conditions:short:in-session 0.280000 0.020000 0.300000 ( 0.424613)
DataMapper:conditions:long 0.300000 0.020000 0.320000 ( 0.446678)
DataMapper:conditions:long:in-session 0.280000 0.020000 0.300000 ( 0.423306)
ActiveRecord:insert 10.950000 0.450000 11.400000 ( 12.196582)
DataMapper:insert 1.540000 0.100000 1.640000 ( 2.102458)
ActiveRecord:update 0.510000 0.090000 0.600000 ( 0.855040)
DataMapper:update 0.340000 0.020000 0.360000 ( 0.486113)
ActiveRecord:associations:lazy 4.510000 0.490000 5.000000 ( 8.287006)
ActiveRecord:associations:included 4.570000 0.030000 4.600000 ( 5.325725)
DataMapper:associations 4.980000 0.050000 5.030000 ( 5.375342)
DataMapper:associations:in-session 1.270000 0.020000 1.290000 ( 1.425380)
ActiveRecord:find_by_sql 0.290000 0.020000 0.310000 ( 0.439328)
DataMapper:find_by_sql 12.030000 0.090000 12.120000 ( 12.352025)
ActiveRecord:accessors 0.010000 0.000000 0.010000 ( 0.012992)
DataMapper:accessors 0.010000 0.000000 0.010000 ( 0.007750)
Routine baseline test for 0.2.2:
user system total real
ActiveRecord:id 0.100000 0.020000 0.120000 ( 0.200836)
DataMapper:id 0.300000 0.020000 0.320000 ( 0.402018)
DataMapper:id:in-session 0.060000 0.000000 0.060000 ( 0.061743)
ActiveRecord:all 0.330000 0.020000 0.350000 ( 0.483547)
DataMapper:all 1.130000 0.020000 1.150000 ( 1.297910)
DataMapper:all:in-session 0.850000 0.020000 0.870000 ( 0.997216)
ActiveRecord:conditions 0.110000 0.020000 0.130000 ( 0.249338)
DataMapper:conditions:short 0.300000 0.030000 0.330000 ( 0.437872)
DataMapper:conditions:short:in-session 0.270000 0.020000 0.290000 ( 0.415954)
DataMapper:conditions:long 0.300000 0.020000 0.320000 ( 0.439868)
DataMapper:conditions:long:in-session 0.280000 0.020000 0.300000 ( 0.420295)
ActiveRecord:insert 11.070000 0.460000 11.530000 ( 12.424877)
DataMapper:insert 1.600000 0.100000 1.700000 ( 2.123499)
ActiveRecord:update 0.510000 0.090000 0.600000 ( 0.879385)
DataMapper:update 0.330000 0.020000 0.350000 ( 0.508269)
ActiveRecord:associations:lazy 4.440000 0.490000 4.930000 ( 8.236656)
ActiveRecord:associations:included 4.710000 0.040000 4.750000 ( 5.486082)
DataMapper:associations 3.910000 0.040000 3.950000 ( 4.300448)
DataMapper:associations:in-session 0.930000 0.020000 0.950000 ( 1.072595)
ActiveRecord:find_by_sql 0.290000 0.020000 0.310000 ( 0.438988)
DataMapper:find_by_sql 0.320000 0.020000 0.340000 ( 0.483293)
DataMapper:raw-query 0.130000 0.020000 0.150000 ( 0.288194)
ActiveRecord:accessors 0.010000 0.000000 0.010000 ( 0.013859)
DataMapper:accessors 0.000000 0.000000 0.000000 ( 0.007755)
Frozen attributes:
user system total real
ActiveRecord:id 0.100000 0.020000 0.120000 ( 0.200084)
DataMapper:id 0.300000 0.020000 0.320000 ( 0.403073)
DataMapper:id:in-session 0.060000 0.000000 0.060000 ( 0.061662)
ActiveRecord:all 0.330000 0.020000 0.350000 ( 0.488180)
DataMapper:all 1.130000 0.030000 1.160000 ( 1.284038)
DataMapper:all:in-session 0.870000 0.020000 0.890000 ( 1.018347)
ActiveRecord:conditions 0.100000 0.020000 0.120000 ( 0.244069)
DataMapper:conditions:short 0.290000 0.020000 0.310000 ( 0.438676)
DataMapper:conditions:short:in-session 0.270000 0.020000 0.290000 ( 0.418105)
DataMapper:conditions:long 0.300000 0.020000 0.320000 ( 0.442747)
DataMapper:conditions:long:in-session 0.280000 0.020000 0.300000 ( 0.421202)
ActiveRecord:insert 10.990000 0.440000 11.430000 ( 12.228132)
DataMapper:insert 1.600000 0.100000 1.700000 ( 2.109715)
ActiveRecord:update 0.490000 0.090000 0.580000 ( 0.841281)
DataMapper:update 0.330000 0.020000 0.350000 ( 0.477265)
ActiveRecord:associations:lazy 4.450000 0.480000 4.930000 ( 8.245103)
ActiveRecord:associations:included 4.600000 0.030000 4.630000 ( 5.362895)
DataMapper:associations 3.870000 0.050000 3.920000 ( 4.271564)
DataMapper:associations:in-session 0.950000 0.020000 0.970000 ( 1.102860)
ActiveRecord:find_by_sql 0.290000 0.020000 0.310000 ( 0.442986)
DataMapper:find_by_sql 0.320000 0.020000 0.340000 ( 0.483927)
DataMapper:raw-query 0.130000 0.020000 0.150000 ( 0.294662)
ActiveRecord:accessors 0.020000 0.000000 0.020000 ( 0.015246)
DataMapper:accessors 0.010000 0.000000 0.010000 ( 0.007762)
Original_values instead of original_hashes:
user system total real
ActiveRecord:id 0.100000 0.020000 0.120000 ( 0.199365)
DataMapper:id 0.300000 0.020000 0.320000 ( 0.411072)
DataMapper:id:in-session 0.060000 0.000000 0.060000 ( 0.062074)
ActiveRecord:all 0.320000 0.020000 0.340000 ( 0.479386)
DataMapper:all 1.160000 0.020000 1.180000 ( 1.320178)
DataMapper:all:in-session 0.840000 0.020000 0.860000 ( 0.987655)
ActiveRecord:conditions 0.100000 0.020000 0.120000 ( 0.241978)
DataMapper:conditions:short 0.300000 0.020000 0.320000 ( 0.443261)
DataMapper:conditions:short:in-session 0.270000 0.020000 0.290000 ( 0.415863)
DataMapper:conditions:long 0.300000 0.020000 0.320000 ( 0.443250)
DataMapper:conditions:long:in-session 0.270000 0.020000 0.290000 ( 0.420265)
ActiveRecord:insert 11.000000 0.440000 11.440000 ( 12.263029)
DataMapper:insert 1.610000 0.100000 1.710000 ( 2.113757)
ActiveRecord:update 0.500000 0.080000 0.580000 ( 0.856348)
DataMapper:update 0.330000 0.020000 0.350000 ( 0.472541)
ActiveRecord:associations:lazy 4.430000 0.480000 4.910000 ( 8.220179)
ActiveRecord:associations:included 4.690000 0.030000 4.720000 ( 5.461092)
DataMapper:associations 3.860000 0.040000 3.900000 ( 4.268797)
DataMapper:associations:in-session 0.920000 0.020000 0.940000 ( 1.078688)
ActiveRecord:find_by_sql 0.290000 0.020000 0.310000 ( 0.443165)
DataMapper:find_by_sql 0.310000 0.020000 0.330000 ( 0.480190)
DataMapper:raw-query 0.130000 0.020000 0.150000 ( 0.293561)
ActiveRecord:accessors 0.010000 0.000000 0.010000 ( 0.015029)
DataMapper:accessors 0.000000 0.000000 0.000000 ( 0.007767)
Parameterized Execution:
user system total real
ActiveRecord:id 0.100000 0.020000 0.120000 ( 0.204708)
DataMapper:id 0.290000 0.020000 0.310000 ( 0.400942)
DataMapper:id:in-session 0.060000 0.000000 0.060000 ( 0.060428)
ActiveRecord:all 0.330000 0.020000 0.350000 ( 0.485907)
DataMapper:all 1.120000 0.020000 1.140000 ( 1.276078)
DataMapper:all:in-session 0.820000 0.020000 0.840000 ( 0.972161)
ActiveRecord:conditions 0.100000 0.020000 0.120000 ( 0.248759)
DataMapper:conditions:short 0.290000 0.020000 0.310000 ( 0.440282)
DataMapper:conditions:short:in-session 0.220000 0.020000 0.240000 ( 0.360253)
DataMapper:conditions:long 0.300000 0.020000 0.320000 ( 0.438962)
DataMapper:conditions:long:in-session 0.220000 0.020000 0.240000 ( 0.362050)
ActiveRecord:insert 10.950000 0.460000 11.410000 ( 12.220599)
DataMapper:insert 1.650000 0.100000 1.750000 ( 2.237006)
ActiveRecord:update 0.500000 0.090000 0.590000 ( 0.849031)
DataMapper:update 0.320000 0.020000 0.340000 ( 0.473710)
ActiveRecord:associations:lazy 4.460000 0.490000 4.950000 ( 8.319213)
ActiveRecord:associations:included 4.670000 0.040000 4.710000 ( 5.413298)
DataMapper:associations 3.830000 0.040000 3.870000 ( 4.251812)
DataMapper:associations:in-session 0.910000 0.020000 0.930000 ( 1.058053)
ActiveRecord:find_by_sql 0.290000 0.020000 0.310000 ( 0.441161)
DataMapper:find_by_sql 0.330000 0.030000 0.360000 ( 0.494727)
DataMapper:raw-query 0.140000 0.010000 0.150000 ( 0.300567)
ActiveRecord:accessors 0.010000 0.000000 0.010000 ( 0.013660)
DataMapper:accessors 0.000000 0.000000 0.000000 ( 0.007752)
Context#get:
user system total real
ActiveRecord:id 0.100000 0.030000 0.130000 ( 0.223749)
DataMapper:id 0.250000 0.020000 0.270000 ( 0.364658)
DataMapper:id:in-session 0.170000 0.020000 0.190000 ( 0.280089)
ActiveRecord:all 0.270000 0.020000 0.290000 ( 0.441299)
DataMapper:all 1.440000 0.040000 1.480000 ( 1.625877)
DataMapper:all:in-session 0.940000 0.030000 0.970000 ( 1.106244)
ActiveRecord:conditions 0.110000 0.020000 0.130000 ( 0.246983)
DataMapper:conditions:short 0.330000 0.020000 0.350000 ( 0.470939)
DataMapper:conditions:short:in-session 0.310000 0.020000 0.330000 ( 0.475240)
DataMapper:conditions:long 0.330000 0.020000 0.350000 ( 0.489315)
DataMapper:conditions:long:in-session 0.290000 0.020000 0.310000 ( 0.431388)
ActiveRecord:insert 4.260000 0.330000 4.590000 ( 5.959658)
DataMapper:insert 2.260000 0.100000 2.360000 ( 2.829934)
ActiveRecord:update 0.490000 0.090000 0.580000 ( 0.838985)
DataMapper:update 0.420000 0.020000 0.440000 ( 0.569356)
ActiveRecord:associations:lazy 3.940000 0.410000 4.350000 ( 7.117446)
ActiveRecord:associations:included 4.550000 0.030000 4.580000 ( 5.322600)
DataMapper:associations 7.070000 0.060000 7.130000 ( 7.505041)
DataMapper:associations:in-session 1.020000 0.030000 1.050000 ( 1.180888)
ActiveRecord:find_by_sql 0.230000 0.020000 0.250000 ( 0.374959)
DataMapper:find_by_sql 0.450000 0.120000 0.570000 ( 0.963270)
DataMapper:raw-query 0.130000 0.020000 0.150000 ( 0.285216)
ActiveRecord:accessors 0.010000 0.000000 0.010000 ( 0.014831)
DataMapper:accessors 0.030000 0.000000 0.030000 ( 0.030177)
Faster #get (less *splat in the call-stack):
user system total real
ActiveRecord:id 0.110000 0.020000 0.130000 ( 0.218195)
DataMapper:id 0.250000 0.020000 0.270000 ( 0.345180)
DataMapper:id:in-session 0.160000 0.020000 0.180000 ( 0.260807)
ActiveRecord:all 0.270000 0.020000 0.290000 ( 0.418352)
DataMapper:all 1.400000 0.030000 1.430000 ( 1.548471)
DataMapper:all:in-session 0.920000 0.020000 0.940000 ( 1.064559)
ActiveRecord:conditions 0.100000 0.020000 0.120000 ( 0.244208)
DataMapper:conditions:short 0.330000 0.020000 0.350000 ( 0.469044)
DataMapper:conditions:short:in-session 0.290000 0.020000 0.310000 ( 0.433122)
DataMapper:conditions:long 0.330000 0.020000 0.350000 ( 0.466814)
DataMapper:conditions:long:in-session 0.290000 0.020000 0.310000 ( 0.430728)
ActiveRecord:insert 4.260000 0.320000 4.580000 ( 5.755669)
DataMapper:insert 2.270000 0.110000 2.380000 ( 2.795413)
ActiveRecord:update 0.480000 0.080000 0.560000 ( 0.832237)
DataMapper:update 0.430000 0.020000 0.450000 ( 0.570414)
ActiveRecord:associations:lazy 3.870000 0.400000 4.270000 ( 7.031791)
ActiveRecord:associations:included 4.590000 0.040000 4.630000 ( 5.273726)
DataMapper:associations 7.030000 0.060000 7.090000 ( 7.429910)
DataMapper:associations:in-session 1.010000 0.020000 1.030000 ( 1.158633)
ActiveRecord:find_by_sql 0.230000 0.020000 0.250000 ( 0.375564)
DataMapper:find_by_sql 0.450000 0.130000 0.580000 ( 0.911728)
DataMapper:raw-query 0.130000 0.020000 0.150000 ( 0.289264)
ActiveRecord:accessors 0.020000 0.000000 0.020000 ( 0.015105)
DataMapper:accessors 0.030000 0.000000 0.030000 ( 0.031271)
Fastest #get (single method-call, limited iterations, fixed identity-map early return):
user system total real
ActiveRecord:id 0.110000 0.020000 0.130000 ( 0.204608)
DataMapper:id 0.180000 0.020000 0.200000 ( 0.271768)
DataMapper:id:in-session 0.020000 0.000000 0.020000 ( 0.014118)
ActiveRecord:all 0.280000 0.020000 0.300000 ( 0.418101)
DataMapper:all 1.520000 0.020000 1.540000 ( 1.669128)
DataMapper:all:in-session 1.010000 0.020000 1.030000 ( 1.163907)
ActiveRecord:conditions 0.110000 0.020000 0.130000 ( 0.247928)
DataMapper:conditions:short 0.330000 0.020000 0.350000 ( 0.464634)
DataMapper:conditions:short:in-session 0.290000 0.020000 0.310000 ( 0.430232)
DataMapper:conditions:long 0.330000 0.030000 0.360000 ( 0.460992)
DataMapper:conditions:long:in-session 0.280000 0.020000 0.300000 ( 0.425144)
ActiveRecord:insert 4.380000 0.330000 4.710000 ( 5.474600)
DataMapper:insert 2.240000 0.100000 2.340000 ( 2.755951)
ActiveRecord:update 0.470000 0.080000 0.550000 ( 0.781566)
DataMapper:update 0.410000 0.020000 0.430000 ( 0.525973)
ActiveRecord:associations:lazy 3.900000 0.420000 4.320000 ( 7.080422)
ActiveRecord:associations:included 4.400000 0.030000 4.430000 ( 5.112349)
DataMapper:associations 6.780000 0.060000 6.840000 ( 7.178618)
DataMapper:associations:in-session 1.100000 0.020000 1.120000 ( 1.238834)
ActiveRecord:find_by_sql 0.230000 0.020000 0.250000 ( 0.375993)
DataMapper:find_by_sql 0.450000 0.130000 0.580000 ( 0.901768)
DataMapper:raw-query 0.140000 0.020000 0.160000 ( 0.286502)
ActiveRecord:accessors 0.010000 0.000000 0.010000 ( 0.014866)
DataMapper:accessors 0.030000 0.000000 0.030000 ( 0.031177)
More benchmarks to test the performance of the underlying drivers:
user system total real
ActiveRecord:id 0.110000 0.020000 0.130000 ( 0.208672)
ActiveRecord:id:raw_result-set 0.010000 0.020000 0.030000 ( 0.109599)
DataMapper:id 0.170000 0.020000 0.190000 ( 0.268803)
DataMapper:id:in-session 0.020000 0.000000 0.020000 ( 0.014197)
DataMapper:id:raw-result-set 0.050000 0.020000 0.070000 ( 0.136051)
ActiveRecord:all 0.270000 0.020000 0.290000 ( 0.420558)
DataMapper:all 1.460000 0.020000 1.480000 ( 1.605453)
DataMapper:all:in-session 0.990000 0.030000 1.020000 ( 1.131327)
ActiveRecord:conditions 0.110000 0.020000 0.130000 ( 0.250190)
DataMapper:conditions:short 0.320000 0.020000 0.340000 ( 0.462444)
DataMapper:conditions:short:in-session 0.290000 0.020000 0.310000 ( 0.428014)
DataMapper:conditions:long 0.320000 0.020000 0.340000 ( 0.459467)
DataMapper:conditions:long:in-session 0.290000 0.020000 0.310000 ( 0.424365)
ActiveRecord:insert 4.410000 0.320000 4.730000 ( 5.494924)
DataMapper:insert 2.250000 0.100000 2.350000 ( 2.783917)
ActiveRecord:update 0.480000 0.080000 0.560000 ( 0.799163)
DataMapper:update 0.920000 0.060000 0.980000 ( 1.248217)
ActiveRecord:associations:lazy 3.940000 0.420000 4.360000 ( 7.184043)
ActiveRecord:associations:included 4.380000 0.040000 4.420000 ( 5.099299)
DataMapper:associations 6.770000 0.060000 6.830000 ( 7.173094)
DataMapper:associations:in-session 1.070000 0.020000 1.090000 ( 1.209617)
ActiveRecord:find_by_sql 0.230000 0.020000 0.250000 ( 0.376181)
DataMapper:find_by_sql 0.450000 0.130000 0.580000 ( 0.902970)
DataMapper:raw-query 0.140000 0.020000 0.160000 ( 0.286420)
ActiveRecord:accessors 0.010000 0.000000 0.010000 ( 0.015155)
DataMapper:accessors 0.030000 0.000000 0.030000 ( 0.031162)
Materialize with ::allocate instead of ::new:
user system total real
ActiveRecord:id 0.100000 0.020000 0.120000 ( 0.202005)
ActiveRecord:id:raw_result-set 0.010000 0.020000 0.030000 ( 0.103574)
DataMapper:id 0.160000 0.020000 0.180000 ( 0.265041)
DataMapper:id:in-session 0.010000 0.000000 0.010000 ( 0.013084)
DataMapper:id:raw-result-set 0.040000 0.020000 0.060000 ( 0.134362)
ActiveRecord:all 0.260000 0.020000 0.280000 ( 0.402124)
DataMapper:all 1.300000 0.020000 1.320000 ( 1.444538)
DataMapper:all:in-session 0.880000 0.020000 0.900000 ( 1.025989)
ActiveRecord:conditions 0.110000 0.020000 0.130000 ( 0.241918)
DataMapper:conditions:short 0.320000 0.020000 0.340000 ( 0.452805)
DataMapper:conditions:short:in-session 0.280000 0.020000 0.300000 ( 0.422840)
DataMapper:conditions:long 0.310000 0.020000 0.330000 ( 0.450802)
DataMapper:conditions:long:in-session 0.280000 0.020000 0.300000 ( 0.418631)
ActiveRecord:insert 4.180000 0.330000 4.510000 ( 5.263403)
DataMapper:insert 2.220000 0.100000 2.320000 ( 2.807708)
ActiveRecord:update 0.450000 0.080000 0.530000 ( 0.756596)
DataMapper:update 0.920000 0.060000 0.980000 ( 1.228032)
ActiveRecord:associations:lazy 3.790000 0.420000 4.210000 ( 6.955805)
ActiveRecord:associations:included 4.190000 0.040000 4.230000 ( 4.846686)
DataMapper:associations 9.380000 0.050000 9.430000 ( 9.775740)
DataMapper:associations:in-session 1.080000 0.020000 1.100000 ( 1.224072)
ActiveRecord:find_by_sql 0.210000 0.020000 0.230000 ( 0.359958)
DataMapper:find_by_sql 2.760000 0.130000 2.890000 ( 3.227678)
DataMapper:raw-query 0.130000 0.020000 0.150000 ( 0.283691)
ActiveRecord:accessors 0.020000 0.000000 0.020000 ( 0.013469)
DataMapper:accessors 0.030000 0.000000 0.030000 ( 0.029187)