[DRE-maint] [Bug 670743] Re: poor i/o performance in thread parallel to Gtk.main (time overhead can be as bad as 2500%)

Launchpad Bug Tracker 670743 at bugs.launchpad.net
Thu Sep 1 08:59:22 UTC 2011


** Changed in: ruby-gnome2 (Ubuntu)
       Status: New => Confirmed

-- 
You received this bug notification because you are subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/670743

Title:
  poor i/o performance in thread parallel to Gtk.main (time overhead can
  be as bad as 2500%)

Status in “ruby-gnome2” package in Ubuntu:
  Confirmed

Bug description:
  Binary package hint: ruby-gnome2

  rubyripper [1] is performing poorly in maverik x86-64 (up-to-date).
  They have an open issue for this [2].

  Apparently there is nothing wrong with rubyripper. So I managed to
  reduce it to a small test case. It is based in the very first ruby-
  gnome2 example I could find.

  The test function reads 3 MB from /dev/zero. This function is called
  from a new thread.

  This is done 3 times. Before the call to Gtk.main, during it (from a
  button callback signal) and after it.

  These are the times for each one (in seconds).
  0.004285
  9.689063
  0.021076

  Something is wrong.

  Test code follows.

  [1]
  http://code.google.com/p/rubyripper

  [2]
  http://code.google.com/p/rubyripper/issues/detail?id=348

  --
  #!/usr/bin/env ruby

  require 'gtk2'

  def simpleRead
  	puts "simpleRead begin\n"
  	index = 0
  	file = File.open("/dev/zero", 'r')
  	while (index < 3 * 1024 * 1024)
  		file.read(16 * 1024)
  		index += 16 * 1024
  	end
  	file.close()
  	puts "simpleRead end\n"
  end

  def newThreadSimpleRead
  	Thread.new do
  		require "benchmark"
  		puts Benchmark.measure { simpleRead }
  #simpleRead
  	end
  end

  button = Gtk::Button.new("Hello World")
  button.signal_connect("clicked") {
  	newThreadSimpleRead
  }

  window = Gtk::Window.new
  window.signal_connect("delete_event") {
  	puts "delete event occurred"
  	#true
  	false
  }

  window.signal_connect("destroy") {
  	  puts "destroy event occurred"
  		    Gtk.main_quit
  }

  window.border_width = 10
  window.add(button)
  window.show_all

  newThreadSimpleRead
  STDIN.readchar

  Gtk.main

  newThreadSimpleRead
  STDIN.readchar

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ruby-gnome2/+bug/670743/+subscriptions





More information about the Pkg-ruby-extras-maintainers mailing list