From: David Masover Date: 2009-03-10T17:33:04+09:00 Subject: Re: Ruby OpenGL Gears example that uses shiny and velvet GLSL shaders Matthias Reitinger wrote: > Michael Brooks wrote: > >> On another topic, what kind of performance / fps are you getting? My >> past experience has been that Nvidia has better OpenGL drivers than ATI. >> > > reima@marvin:/tmp$ ruby gears_using_shaders.rb > 14146 frames in 5.000 seconds = 2829.200 FPS > My results were frighteningly worse, at first: dave@SERENITY ~/tmp> uname -a Linux serenity 2.6.27-11-generic #1 SMP Thu Jan 29 19:28:32 UTC 2009 x86_64 GNU/Linux dave@SERENITY ~/tmp> 18 ruby -v ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux] dave@SERENITY ~/tmp> 19 ruby -v ruby 1.9.1p0 (2009-01-30 revision 21907) [x86_64-linux] dave@SERENITY ~/tmp> head -n 12 /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 23 model name : Intel(R) Core(TM)2 Duo CPU T9300 @ 2.50GHz stepping : 6 cpu MHz : 800.000 cache size : 6144 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 dave@SERENITY ~/tmp> lspci | grep VGA 01:00.0 VGA compatible controller: nVidia Corporation GeForce 8600M GT (rev a1) dave@SERENITY ~/tmp> 18 ruby -rubygems gears_using_shaders.rb 9232 frames in 5.022 seconds = 1838.311 FPS 9982 frames in 5.000 seconds = 1996.400 FPS 9962 frames in 5.000 seconds = 1992.400 FPS 9923 frames in 5.000 seconds = 1984.600 FPS 9981 frames in 5.000 seconds = 1996.200 FPS dave@SERENITY ~/tmp> 19 ruby gears_using_shaders.rb 9261 frames in 5.000 seconds = 1852.200 FPS 9835 frames in 5.000 seconds = 1967.000 FPS 9880 frames in 5.000 seconds = 1976.000 FPS 9901 frames in 5.000 seconds = 1980.200 FPS 9906 frames in 5.000 seconds = 1981.200 FPS dave@SERENITY ~/tmp> glxgears 11864 frames in 5.0 seconds = 2372.706 FPS 12272 frames in 5.0 seconds = 2453.951 FPS 12457 frames in 5.0 seconds = 2491.129 FPS 11393 frames in 5.0 seconds = 2278.451 FPS 11255 frames in 5.0 seconds = 2246.413 FPS Then I remembered I'm running KDE4, with all kinds of effects turned on. Quickly toggling them off reveals: dave@SERENITY ~/tmp> 18 ruby -rubygems gears_using_shaders.rb 21374 frames in 5.000 seconds = 4274.800 FPS 21964 frames in 5.000 seconds = 4392.800 FPS 22223 frames in 5.005 seconds = 4440.160 FPS 21960 frames in 5.000 seconds = 4392.000 FPS 22011 frames in 5.002 seconds = 4400.440 FPS dave@SERENITY ~/tmp> 19 ruby gears_using_shaders.rb 20571 frames in 5.000 seconds = 4114.200 FPS 21922 frames in 5.000 seconds = 4384.400 FPS 22217 frames in 5.000 seconds = 4443.400 FPS 22022 frames in 5.000 seconds = 4404.400 FPS 21693 frames in 5.000 seconds = 4338.600 FPS dave@SERENITY ~/tmp> glxgears 26268 frames in 5.0 seconds = 5253.481 FPS 27987 frames in 5.0 seconds = 5597.365 FPS 27844 frames in 5.0 seconds = 5568.736 FPS 28008 frames in 5.0 seconds = 5601.509 FPS 28031 frames in 5.0 seconds = 5600.459 FPS Looks like it is GPU-bound -- no real difference between Ruby 1.8.7 and 1.9.1, but a huge difference between compositing and no compositing. For those with KDE4, the default keystroke to toggle desktop effects is shift+alt+f12. Can't live with 'em, can't live without 'em.