Hi Miles, I'm working on a set of AR vs DM vs Sequel benchmarks based on the old performance.rb script that was a part of dm-core project. Here's what I've got so far, it will give you a better overview: https://gist.github.com/949624
I wouldn't be worried about such micro benchmarks though. We will focus more on performance when working on DataMapper 2.0, currently it kinda makes less sense unless somebody reports a really terrible performance regression (which did happen in the past few times and all issues were fixed). Cheers # solnic On May 16, 2:13 pm, mileszs <[email protected]> wrote: > I recently gave a presentation at the Indianapolis Ruby Brigade > monthly meeting, covering aspects of DM I like, and recommending the > crowd give it a shot in their next project. I was asked about > performance, as I knew I would be, but I hadn't really taken a good > run at a performance comparison at the time (which seems like a huge > failure on my part, considering I've put a Rails 3 DM app in to > production). Thus, I sat down yesterday intending to get some numbers > I could show people. Unfortunately, the results were surprisingly > negative for DataMapper. I am hoping that I'm unwittingly performing a > poor benchmark. > > You can get the code I used > here:https://github.com/mileszs/dm-v-ar-performance > > In both apps there is a very basic User model. They are using the same > database (on MySQL). The db/seeds.rb file in the DataMapper app > creates 10000 user records. > > I used the recommended app template to generate the DataMapper app: > > rails new dm-perf-app -mhttp://datamapper.org/templates/rails.rb > bundle install > rails g scaffold User email:string > rake db:setup > rake db:seed > > The ActiveRecord app is similar, but uses the same database: > > rails new ar-perf-app > bundle install > rails g scaffold User email:string > > To test performance, I used variations of: > > # DataMapper > env RAILS_ENV=production rails benchmarker "10000.times { |i| u = > User.all(:id => i).first; u.email if u }" > > # ActiveRecord > env RAILS_ENV=production rails benchmarker "10000.times { |i| u = > User.where(:id => i).first; u.email if u }" > > ... which I stole from Luke Ludwig's "Rails 3 Performance - Not Good > Enough article. > > Results: > > DataMapper: > user system total real > #1 10.530000 0.630000 11.160000 ( 12.580429) > > ActiveRecord: > user system total real > #1 3.150000 0.300000 3.450000 ( 4.171568) > > (I have run the test several times with similar results.) Are there > obvious errors in my method? Perhaps some basic things I could do to > improve performance? I really like DataMapper, so it will be > disappointing to report back such a discrepancy in performance. > > Thank you for any help you can provide! > > MilesZS -- You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/datamapper?hl=en.
