Skip to content

Instantly share code, notes, and snippets.

@huydx
Created May 11, 2013 14:17
Show Gist options
  • Save huydx/5560084 to your computer and use it in GitHub Desktop.
Save huydx/5560084 to your computer and use it in GitHub Desktop.
mongo benchmark
%self total self wait child calls name
3.65 0.405 0.254 0.000 0.151 3001 Mongo::Cursor#initialize
3.53 0.791 0.246 0.000 0.545 12001 *Mutex#synchronize
3.51 0.904 0.245 0.000 0.660 3000 Mongo::Collection#find
3.44 0.240 0.240 0.000 0.000 8116 <Class::IO>#select
2.95 0.775 0.205 0.000 0.570 3001 Mongo::Collection#initialize
2.52 0.226 0.175 0.000 0.051 9003 BSON::ByteBuffer#put_binary
2.05 0.546 0.143 0.000 0.403 3001 Mongo::Networking#read_documents
1.82 0.466 0.126 0.000 0.340 8116 Mongo::TCPSocket#read
1.77 1.552 0.123 0.000 1.429 16075 *Class#new
1.71 4.114 0.119 0.000 3.995 3001 <Module::Mongo::Logging::Instrumenter>#instrument
1.71 0.197 0.119 0.000 0.079 9003 BSON::ByteBuffer#put_num
1.53 0.288 0.107 0.000 0.181 12002 Kernel#dup
1.49 0.104 0.104 0.000 0.000 16068 <Class::BasicObject>#allocate
1.46 0.637 0.102 0.000 0.535 8116 Mongo::Networking#receive_data
1.43 0.100 0.100 0.000 0.000 8116 IO#sysread
1.42 1.090 0.099 0.000 0.992 3001 Mongo::Cursor#construct_query_message
1.37 0.130 0.095 0.000 0.034 1057 <Module::CBson>#deserialize
1.34 0.152 0.093 0.000 0.058 7059 BSON::ByteBuffer#initialize
1.28 0.355 0.089 0.000 0.266 3001 Mongo::Networking#receive_response_header
1.26 0.088 0.088 0.000 0.000 3001 IO#write
1.23 0.287 0.086 0.000 0.202 3004 Mongo::WriteConcern#get_write_concern
1.21 0.084 0.084 0.000 0.000 21007 Module#===
1.19 0.102 0.083 0.000 0.019 15007 Array#include?
1.18 0.082 0.082 0.000 0.000 12001 Mutex#unlock
1.14 0.079 0.079 0.000 0.000 9003 String#to_s
1.09 0.076 0.076 0.000 0.000 6002 Mongo::MongoClient#max_bson_size
1.09 0.076 0.076 0.000 0.000 51012 Hash#delete
1.00 0.174 0.070 0.000 0.104 3001 Mongo::Networking#send_message_on_socket
0.95 4.606 0.066 0.000 4.540 4057 Mongo::Cursor#next
0.94 0.200 0.065 0.000 0.135 6001 Time#-
0.90 0.244 0.063 0.000 0.181 1057 <Class::BSON::BSON_C>#deserialize
0.89 0.062 0.062 0.000 0.000 9005 Hash#initialize_copy
0.87 0.698 0.061 0.000 0.637 8116 Mongo::Networking#receive_message_on_socket
0.86 0.060 0.060 0.000 0.000 3000 Array#delete
0.84 0.156 0.059 0.000 0.097 12002 <Class::Time>#now
0.83 4.420 0.058 0.000 4.362 3001 Mongo::Logging#instrument
0.82 0.057 0.057 0.000 0.000 18176 String#force_encoding
0.81 0.056 0.056 0.000 0.000 6001 Fixnum#-
0.76 1.810 0.053 0.000 1.758 3001 Mongo::Networking#receive_message
0.75 0.082 0.052 0.000 0.029 12001 Mutex#lock_with_hack
0.75 0.052 0.052 0.000 0.000 18006 BSON::ByteBuffer#more?
0.73 0.170 0.051 0.000 0.119 15006 Kernel#initialize_dup
0.71 0.050 0.050 0.000 0.000 18006 BSON::ByteBuffer#ensure_length
0.71 0.956 0.050 0.000 0.907 3000 Mongo::DB#collection
0.70 0.049 0.049 0.000 0.000 11116 String#unpack
0.70 0.074 0.048 0.000 0.026 2999 Mongo::Pool#checkout_existing_socket
0.69 1.351 0.048 0.000 1.303 3001 Mongo::Networking#receive
0.69 0.048 0.048 0.000 0.000 3000 Array#initialize_copy
0.65 0.402 0.045 0.000 0.357 3001 Mongo::Networking#receive_header
0.63 0.068 0.044 0.000 0.024 12002 Time#initialize
0.62 0.069 0.043 0.000 0.026 8116 Mongo::Networking#new_binary_string
0.61 0.042 0.042 0.000 0.000 3002 Hash#keys
0.60 0.042 0.042 0.000 0.000 3001 Mongo::Cursor#instrument_payload
0.57 0.040 0.040 0.000 0.000 6002 Regexp#match
0.55 0.224 0.038 0.000 0.186 3001 Mongo::Networking#add_message_headers
0.54 0.038 0.038 0.000 0.000 12004 Array#pack
0.53 0.179 0.037 0.000 0.142 3004 Hash#reject
0.53 0.234 0.037 0.000 0.197 9003 BSON::ByteBuffer#put_int
0.52 0.412 0.036 0.000 0.375 3000 Kernel#loop
0.52 0.036 0.036 0.000 0.000 6000 Mongo::ReadPreference#read_preference
0.52 0.049 0.036 0.000 0.013 6005 <Module::Mongo::ReadPreference>#validate
0.50 0.597 0.035 0.000 0.563 3000 Mongo::Cursor#checkout_socket_from_connection
0.49 0.045 0.034 0.000 0.011 3001 Mongo::Cursor#batch_size
0.49 0.034 0.034 0.000 0.000 18014 Hash#fetch
0.48 0.296 0.034 0.000 0.262 3001 <Class::BSON::BSON_RUBY>#serialize_cstr
0.48 0.042 0.033 0.000 0.008 10060 Kernel#respond_to?
0.46 0.032 0.032 0.000 0.000 13065 <Class::Hash>#allocate
0.43 0.030 0.030 0.000 0.000 3001 <Module::CBson>#serialize
0.42 0.029 0.029 0.000 0.000 12001 Mutex#lock_without_hack
0.42 0.499 0.029 0.000 0.469 3000 Mongo::Pool#checkout
0.42 0.029 0.029 0.000 0.000 12002 <Class::Time>#allocate
0.41 0.207 0.029 0.000 0.178 3000 ConditionVariable#broadcast
0.41 0.089 0.029 0.000 0.060 3001 <Class::BSON::BSON_RUBY>#to_utf8_binary
0.41 0.047 0.029 0.000 0.019 6001 Mongo::MongoClient#connected?
0.40 0.035 0.028 0.000 0.007 1000 Kernel#p
0.40 4.638 0.028 0.000 4.610 3000 Mongo::Cursor#each
0.38 0.027 0.027 0.000 0.000 9007 Hash#merge!
0.38 0.045 0.027 0.000 0.018 3001 Mongo::Cursor#convert_fields_for_query
0.38 0.041 0.027 0.000 0.015 3001 Mongo::Networking#check_response_flags
0.38 4.516 0.026 0.000 4.490 4057 Mongo::Cursor#refresh
0.36 0.025 0.025 0.000 0.000 15001 Symbol#==
0.36 4.487 0.025 0.000 4.462 3001 Mongo::Cursor#send_initial_query
0.36 1.000 0.025 0.000 0.975 3000 <Class::Database>#coll
0.36 0.025 0.025 0.000 0.000 9342 Hash#[]=
0.35 1.948 0.024 0.000 1.924 3000 <Class::UserFriends>#find
0.35 0.024 0.024 0.000 0.000 12003 Fixnum#+
0.34 0.024 0.024 0.000 0.000 7059 BSON::ByteBuffer#to_s
0.34 0.024 0.024 0.000 0.000 10059 Fixnum#&
0.33 0.548 0.023 0.000 0.525 3000 Mongo::MongoClient#checkout_reader
0.32 0.045 0.023 0.000 0.022 6001 Numeric#quo
0.32 0.022 0.022 0.000 0.000 6001 Rational#/
0.32 0.062 0.022 0.000 0.040 6002 String#match
0.31 0.138 0.022 0.000 0.117 3001 Mongo::Networking#get_request_id
0.31 0.027 0.022 0.000 0.006 3001 BSON::ByteBuffer#prepend!
0.30 0.439 0.021 0.000 0.418 3000 SocketUtil#checkin
0.30 0.034 0.021 0.000 0.013 6001 Rational#to_f
0.30 0.418 0.021 0.000 0.397 3000 Mongo::Pool#checkin
0.29 0.169 0.020 0.000 0.149 3001 <Class::BSON::BSON_C>#serialize
0.29 1.020 0.020 0.000 1.000 3000 <Class::UserFriends>#coll
0.27 0.019 0.019 0.000 0.000 6001 Mongo::Pool#closed?
0.26 0.044 0.018 0.000 0.026 3001 Mongo::Cursor#query_contains_special_fields?
0.25 0.017 0.017 0.000 0.000 6005 Kernel#is_a?
0.24 0.017 0.017 0.000 0.000 6012 String#include?
0.23 0.016 0.016 0.000 0.000 3001 <Module::Mongo::Logging>#instrumenter
0.23 0.083 0.016 0.000 0.067 3001 Mongo::MongoClient#max_message_size
0.22 0.104 0.016 0.000 0.088 3001 Mongo::TCPSocket#send
0.22 0.026 0.016 0.000 0.010 3001 Mongo::Cursor#needs_read_pref?
0.21 0.019 0.015 0.000 0.004 3000 <Class::Database>#db
0.21 0.014 0.014 0.000 0.000 3000 Mongo::Pool#check_prune
0.20 0.014 0.014 0.000 0.000 4060 Hash#initialize
0.20 0.020 0.014 0.000 0.006 3002 SocketUtil#closed?
0.19 0.013 0.013 0.000 0.000 6002 <Class::Thread>#current
0.19 0.013 0.013 0.000 0.000 6001 Fixnum#fdiv
0.19 0.013 0.013 0.000 0.000 1944 Exception#initialize
0.18 0.012 0.012 0.000 0.000 6000 Kernel#block_given?
0.18 0.025 0.012 0.000 0.013 1944 NameError#initialize
0.17 0.012 0.012 0.000 0.000 3001 Mongo::Cursor#close_cursor_if_query_complete
0.17 0.012 0.012 0.000 0.000 3000 Mongo::DB#strict?
0.16 0.018 0.011 0.000 0.006 3001 BasicObject#!=
0.16 0.037 0.011 0.000 0.025 1944 NoMethodError#initialize
0.16 0.011 0.011 0.000 0.000 3001 Mongo::Logging#log_operation
0.16 0.011 0.011 0.000 0.000 4057 Kernel#respond_to_missing?
0.16 0.011 0.011 0.000 0.000 6000 Kernel#object_id
0.16 0.011 0.011 0.000 0.000 3001 Mongo::Cursor#check_modifiable
0.15 0.011 0.011 0.000 0.000 3700 Kernel#nil?
0.15 0.010 0.010 0.000 0.000 3001 Mongo::MongoClient#mongos?
0.15 0.010 0.010 0.000 0.000 3001 BSON::ByteBuffer#size
0.14 0.010 0.010 0.000 0.000 4057 Array#shift
0.13 0.009 0.009 0.000 0.000 4415 NilClass#nil?
0.13 0.009 0.009 0.000 0.000 3001 String#initialize_copy
0.13 0.009 0.009 0.000 0.000 3001 Fixnum#<<
0.13 0.012 0.009 0.000 0.003 1056 Kernel#rand
0.12 0.009 0.009 0.000 0.000 3001 <Class::String>#allocate
0.12 0.009 0.009 0.000 0.000 1944 Exception#set_backtrace
0.12 0.009 0.009 0.000 0.000 3004 Hash#key?
0.12 0.008 0.008 0.000 0.000 3002 Array#each
0.12 0.008 0.008 0.000 0.000 3001 Hash#empty?
0.12 0.008 0.008 0.000 0.000 3003 String#empty?
0.12 0.008 0.008 0.000 0.000 3000 Mongo::MongoClient#pin_pool
0.11 0.008 0.008 0.000 0.000 3000 <Class::Array>#allocate
0.11 0.008 0.008 0.000 0.000 3003 Kernel#class
0.11 0.008 0.008 0.000 0.000 3000 Array#clear
0.10 0.007 0.007 0.000 0.000 3001 <Module::Process>#pid
0.10 0.007 0.007 0.000 0.000 1000 String#inspect
0.10 0.007 0.007 0.000 0.000 3000 Array#reject!
0.10 0.007 0.007 0.000 0.000 2118 Hash#[]
0.09 0.006 0.006 0.000 0.000 3002 IO#closed?
0.09 0.006 0.006 0.000 0.000 3001 Kernel#hash
0.09 0.006 0.006 0.000 0.000 1944 Exception#backtrace
0.07 0.005 0.005 0.000 0.000 1056 BSON::ObjectId#initialize
0.07 0.005 0.005 0.000 0.000 1944 Exception#exception
0.06 0.004 0.004 0.000 0.000 1001 Fixnum#to_s
0.04 0.003 0.003 0.000 0.000 1058 Fixnum#zero?
0.01 0.000 0.000 0.000 0.000 2 <Class::Socket>#getaddrinfo
0.00 0.000 0.000 0.000 0.000 2 Socket#connect
0.00 6.966 0.000 0.000 6.966 1 Global#[No method]
0.00 0.001 0.000 0.000 0.001 2 Mongo::TCPSocket#initialize
0.00 0.003 0.000 0.000 0.003 2 Timeout#timeout
0.00 0.000 0.000 0.000 0.000 2 Socket#initialize
0.00 0.000 0.000 0.000 0.000 2 <Class::Thread>#start
0.00 0.004 0.000 0.000 0.004 1 Mongo::MongoClient#setup
0.00 6.957 0.000 0.000 6.957 1944 *BasicObject#method_missing
0.00 0.000 0.000 0.000 0.000 2 Mongo::DB#initialize
0.00 0.000 0.000 0.000 0.000 1 Mongo::Pool#initialize
0.00 6.966 0.000 0.000 6.966 1000 *Integer#times
0.00 0.000 0.000 0.000 0.000 2 <Class::Socket>#pack_sockaddr_in
0.00 0.004 0.000 0.000 0.004 1 Mongo::MongoClient#connect
0.00 0.002 0.000 0.000 0.002 1 Mongo::DB#command
0.00 6.966 0.000 0.000 6.966 1 FriendRecommenderDB#random_walk
0.00 0.000 0.000 0.000 0.000 2 Mongo::Support#validate_db_name
0.00 0.000 0.000 0.000 0.000 2 Thread#join
0.00 0.004 0.000 0.000 0.004 1 Mongo::MongoClient#initialize
0.00 0.000 0.000 0.000 0.000 2 BasicSocket#setsockopt
0.00 0.000 0.000 0.000 0.000 1 IO#close
0.00 0.004 0.000 0.000 0.004 1 Mongo::MongoClient#check_is_master
0.00 0.000 0.000 0.000 0.000 1 Mongo::Pool#checkout_new_socket
0.00 0.004 0.000 0.000 0.004 1 Mongo::Connection#initialize
0.00 0.001 0.000 0.000 0.001 2 Mongo::TCPSocket#connect
0.00 0.000 0.000 0.000 0.000 2 Thread#kill
0.00 0.000 0.000 0.000 0.000 1 Time#utc
0.00 0.000 0.000 0.000 0.000 1 Mongo::MongoClient#apply_saved_authentication
0.00 0.000 0.000 0.000 0.000 1 Mongo::MongoClient#parse_init
0.00 0.000 0.000 0.000 0.000 2 <Class::IO>#new
0.00 0.000 0.000 0.000 0.000 2 Fixnum#==
0.00 0.000 0.000 0.000 0.000 1 Mongo::MongoClient#set_primary
0.00 0.000 0.000 0.000 0.000 4 <Class::Mutex>#allocate
0.00 0.000 0.000 0.000 0.000 1 Mongo::MongoClient#db
0.00 0.000 0.000 0.000 0.000 1 Mongo::MongoClient#check_opts
0.00 0.000 0.000 0.000 0.000 4 Mutex#initialize
0.00 0.000 0.000 0.000 0.000 1 Mongo::DB#ok?
0.00 0.000 0.000 0.000 0.000 1 SocketUtil#close
0.00 0.000 0.000 0.000 0.000 2 <Class::IO>#allocate
0.00 0.000 0.000 0.000 0.000 1 ConditionVariable#initialize
0.00 0.000 0.000 0.000 0.000 2 Array#first
0.00 0.000 0.000 0.000 0.000 2 Mongo::MongoClient#host_port
0.00 0.000 0.000 0.000 0.000 1 Mongo::Support#ok?
0.00 0.000 0.000 0.000 0.000 1 Proc#yield
0.00 0.000 0.000 0.000 0.000 1 Mongo::MongoClient#[]
0.00 0.000 0.000 0.000 0.000 2 BasicObject#==
0.00 0.000 0.000 0.000 0.000 1 Mongo::DB#system_command_collection
0.00 0.000 0.000 0.000 0.000 1 Mongo::MongoClient#close
0.00 0.000 0.000 0.000 0.000 2 Array#last
0.00 0.000 0.000 0.000 0.000 2 Array#empty?
0.00 0.000 0.000 0.000 0.000 1 String#end_with?
0.00 0.000 0.000 0.000 0.000 1 Fixnum#divmod
0.00 0.000 0.000 0.000 0.000 2 Fixnum#<=>
0.00 0.000 0.000 0.000 0.000 1 Hash#has_key?
0.00 0.000 0.000 0.000 0.000 1 <Object::Object>#has_key?
0.00 0.000 0.000 0.000 0.000 1 Array#reject
0.00 0.000 0.000 0.000 0.000 1 Hash#default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment