On 03/20/2012 02:00 PM, Stephan Kulow wrote:
Now that I have the initial port of obs api to rails 3 finished, I consider staying forever on rails2 :)
I have this little benchmark that I initially wrote to check if it's worth talking to the API in json instead of the usual XML:
prjs = DbProject.find :all x = Benchmark.realtime { prjs.each { |p| p.expand_flags.to_json } } y = Benchmark.realtime { prjs.each { |p| p.to_axml('flagdetails') } puts "#{x} #{y}"
And indeed with rails 2.3.14, it shows json is good: 0.108472093 0.379935258
But now with rails 3.2.1 both are slower ;( 0.515888469 1.334631859
Both are with ruby 1.9.3
We saw a drop in performance as well in susestudio.com after switching from Rails 2.3 to Rails 3.1, on Ruby 1.8.7. Although in our case it seems to be related to more to the database/ActiveRecord. Don't have any numbers though. In your case, maybe you should look at other JSON and XML libraries if you haven't already done so. Cheers, James T. -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org