Page 1 of 1

rubygame slow. Increasing fps?

PostPosted: Fri Dec 24, 2010 2:10 am
by programx
Hi all, some time ago that I program in pygame and I appreciate the difference in rubygame, and the latter I found much better syntactic and also much more understandable, more like an improved version of pygame, but I could note is that it is much slower than pygame, as did several tests from some games I had in a pygame to rubygame and when in pygame they ran at 60 fps, in rubygame ran at 30 fps, then my question is:
There is a way to optimize rubygame?, use Surface['image'] to load the images and do not know if that affects performance, or if there is any better method to upload images or a trick to raise the fps I would be grateful, Greetings!.

By the way, I use windows xp, ruby 1.9.2 and rubygame 2.6.4 (i install it via rubygems).

Re: rubygame slow. Increasing fps?

PostPosted: Mon Dec 27, 2010 1:36 pm
by programx
I see no answer to this question, to draw in rubygame fps plummet, and already tried everything but it seems the same library, I definitely change to Gosu, I did some tests and is much faster .

Re: rubygame slow. Increasing fps?

PostPosted: Tue Dec 28, 2010 4:48 am
by Rusty
Try using ruby-prof to profile your application and see where the bottlenecks are.

Code: Select all
require File.expand_path(File.dirname(__FILE__)) + "/config/environment.rb"
require 'ruby-prof'
results = RubyProf.profile do
  game = Game.new
  game.run
end
printer = RubyProf::GraphHtmlPrinter.new(results)
printer.print(File.new("report.html","w"))


You can produce something like this:

Image