From b3a9d93096324de1ef99d638f7bf8142f8956ef2 Mon Sep 17 00:00:00 2001 From: Tyler Brock Date: Mon, 23 Apr 2012 16:58:11 -0400 Subject: [PATCH 1/4] RUBY-436 Handle IRB::Abort Exception --- lib/mongo/networking.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/mongo/networking.rb b/lib/mongo/networking.rb index 62cee62..97cc7ea 100644 --- a/lib/mongo/networking.rb +++ b/lib/mongo/networking.rb @@ -140,6 +140,11 @@ module Mongo rescue SystemStackError, NoMemoryError, SystemCallError => ex close raise ex + rescue Exception => ex + if defined?(IRB) + close if ex.class == IRB::Abort + end + raise ex ensure if should_checkin if command || read == :primary From d3955e0346fd7839fca873df60a242ab06d60674 Mon Sep 17 00:00:00 2001 From: Gary Murakami Date: Tue, 24 Apr 2012 12:35:33 -0400 Subject: [PATCH 2/4] performance graphing and profiling improvements --- Gemfile | 1 + Rakefile | 10 ++++++++++ bench/exp_series.html | 8 +++----- bench/profile_array.rb | 26 ++++++++++++++++++++------ 4 files changed, 34 insertions(+), 11 deletions(-) diff --git a/Gemfile b/Gemfile index 2c12bbe..79f6d80 100644 --- a/Gemfile +++ b/Gemfile @@ -17,6 +17,7 @@ group :development, :test do gem "ci_reporter" gem "ruby-prof" unless RUBY_PLATFORM =~ /java/ gem "perftools.rb" unless RUBY_PLATFORM =~ /java/ + gem "rake-compiler" # Java platforms :jruby do diff --git a/Rakefile b/Rakefile index cf75565..547474d 100644 --- a/Rakefile +++ b/Rakefile @@ -7,6 +7,8 @@ end require 'fileutils' require 'rake/testtask' require 'rake' +require 'rake/extensiontask' +require 'rake/javaextensiontask' begin require 'git' @@ -20,6 +22,14 @@ end ENV['TEST_MODE'] = 'TRUE' +Rake::ExtensionTask.new('cbson') do |ext| + ext.lib_dir = "lib/bson_ext" +end + +#Rake::JavaExtensionTask.new('jbson') do |ext| # not yet functional +# ext.ext_dir = 'ext/src/org/jbson' +#end + task :java do Rake::Task['build:java'].invoke Rake::Task['test:ruby'].invoke diff --git a/bench/exp_series.html b/bench/exp_series.html index 72675e1..a2b9fb0 100644 --- a/bench/exp_series.html +++ b/bench/exp_series.html @@ -25,7 +25,7 @@

Exp Series Performance Tests

x-axis is power of 2, log base 2 of size
y-axis is operations per user-time CPU-second
- Note that this is not operations per real-time second that includes DB real-time
+ Note that this is not operations per real-time second that include DB real-time