1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
require 'rubygems' require 'sequel' require 'benchmark' # set up Sequel Sequel::Model.db = DB = Sequel.sqlite('perf_sequel.db') class SequelItem < Sequel::Model(:items) set_schema do primary_key :id varchar :name text :description boolean :active timestamp :created_at end end # create schema and populate SequelItem.create_table! 1000.times do |i| DB[:items].insert(:name => "record_#{i}", :description => "test record", :active => i.remainder(3).zero?, :created_at => Time.now) end # run benchmarks Benchmark.bmbm do |x| x.report('sequel single-thread') do 100.times do SequelItem.where(:active => false).all end end x.report('sequel threaded') do threads = [] 10.times do t = Thread.new do 10.times do SequelItem.where(:active => false).all end end threads.push(t) end threads.each { |t| t.join } end end SequelItem.drop_table
Refactorings
No refactoring yet !
broornDueni
August 18, 2010, August 18, 2010 05:38, permalink
Hello everybody, I saw this forum recently and I think it is time for me to join. I'm attracted to your topics here. I hope I can find trustable people here. C ya around
broornDueni
August 18, 2010, August 18, 2010 07:01, permalink
Hello everybody, I saw this forum recently and I think it is time for me to join. I'm attracted to your topics here. I hope I can find trustable people here. C ya around
broornDueni
August 18, 2010, August 18, 2010 08:32, permalink
Hello everybody, I saw this forum recently and I think it is time for me to join. I'm attracted to your topics here. I hope I can find trustable people here. C ya around
broornDueni
August 18, 2010, August 18, 2010 10:06, permalink
Hello everybody, I saw this forum recently and I think it is time for me to join. I'm attracted to your topics here. I hope I can find trustable people here. C ya around
broornDueni
August 18, 2010, August 18, 2010 11:42, permalink
Hello everybody, I saw this forum recently and I think it is time for me to join. I'm attracted to your topics here. I hope I can find trustable people here. C ya around
broornDueni
August 18, 2010, August 18, 2010 13:06, permalink
Hello everybody, I saw this forum recently and I think it is time for me to join. I'm attracted to your topics here. I hope I can find trustable people here. C ya around
broornDueni
August 18, 2010, August 18, 2010 14:33, permalink
Hello everybody, I saw this forum recently and I think it is time for me to join. I'm attracted to your topics here. I hope I can find trustable people here. C ya around
broornDueni
August 18, 2010, August 18, 2010 18:00, permalink
Hello everybody, I saw this forum recently and I think it is time for me to join. I'm attracted to your topics here. I hope I can find trustable people here. C ya around
broornDueni
August 18, 2010, August 18, 2010 20:50, permalink
Hello everybody, I saw this forum recently and I think it is time for me to join. I'm attracted to your topics here. I hope I can find trustable people here. C ya around
broornDueni
August 18, 2010, August 18, 2010 22:06, permalink
Hello everybody, I saw this forum recently and I think it is time for me to join. I'm attracted to your topics here. I hope I can find trustable people here. C ya around
broornDueni
August 18, 2010, August 18, 2010 23:24, permalink
Hello everybody, I saw this forum recently and I think it is time for me to join. I'm attracted to your topics here. I hope I can find trustable people here. C ya around
creardahNat
August 28, 2010, August 28, 2010 18:26, permalink
Hello everybody,
What online zines do you read and would recommend? I am a avid fan of emo.
For all you punk people out there I would like to recommend The Enough Fanzine. It is one of the first emo ezines on the www.
They have throusands of interviews from the most popular bands all over the world. Check them out online: http://www.enoughfanzine.com
Best of it all, they are 100% non-profit ...
Looking forward to your recommendations.
Regards!
second of three, not as fast as ActiveRecord - why?