Home Wiki > openSUSE:Appliances events workshop Nuremberg 2010 projects WebYaST Performance
Sign up | Login

openSUSE:Appliances events workshop Nuremberg 2010 projects WebYaST Performance

tagline: From openSUSE

WebYast Performance

Team

Lead: Michal Žugec
Members: Jozef Uhliarik

Objective

The objective here is to find possible ways how to improve WebYaST performance.

The reasons:

  • Reloading single page takes several seconds
  • There were some requests about improving performance
  • We even don't know what are the bottleneck of performance

Tasks

Replace XML parser

  • We are using rexml parser which is very slow comparing to others (nokogiri, libxml-ruby, hpricot)
  • It's only reason is that it's built-in standart rails
  • According our tests we can improve performance about 15% by using another parser (nokogiri or libxml-ruby)
  • Maybe we can benefit from replacing XML by JSON

Find and fix performance bottleneck

  • We used RubyProf to create profiler report of webclient and kcachegrind to visualize it
  • It spend most of the time waiting for backend's response
  • We need to profile also backend

Results

XML parser

rexml

  • this is what we're using now
  • test/functional/groups_controller_test.rb

Finished in 4.307689 seconds. Finished in 4.31859 seconds. Finished in 4.2826 seconds.

8.55s, 8.75s, 8.67s

libxml

  • test/functional/groups_controller_test.rb

Finished in 3.218182 seconds. Finished in 2.951006 seconds. Finished in 3.040806 seconds.

7.4s, 7.61s, 7.4s

nokogiri

  • test/functional/groups_controller_test.rb

Finished in 2.967758 seconds. Finished in 3.04099 seconds. Finished in 2.992017 seconds.

7.66s, 7.43s, 7.11s

Profiling graphs

      require 'ruby-prof'

      RubyProf.start

      # code we want to profile
      all_groups=Group.find :all

      result = RubyProf.stop
      printer = RubyProf::CallTreePrinter.new(result)
      printer.print(File.new ('/tmp/profiling.prof', 'w+'), :min_percent=>00)

Then you can see profiling graph in viewer:

kcachegrind /tmp/profiling.prof