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

Pedro Pedruzzi 670743 at bugs.launchpad.net
Thu Nov 4 03:00:54 UTC 2010


Public bug reported:

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

** Affects: ruby-gnome2 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
poor i/o performance in thread parallel to Gtk.main (time overhead can be as bad as 2500%)
https://bugs.launchpad.net/bugs/670743
You received this bug notification because you are subscribed to Ubuntu.

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

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







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