Project

yuslow

0.0
No commit activity in last 3 years
No release in over 3 years
Y U Slow gives you a simple way to break down and debug why specific piece of code is slow.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.10
 Project Readme

Yuslow

Yuslow [waɪ ju sləʊ] is a lightweight profiler for Ruby designed to debug slow parts of your system.

Install

gem install yuslow

Usage

Require the gem in the file which you would like to investigate.

require 'yuslow'

then add

Yuslow.investigate do
  a_very_slow_method
end

or

investigation = Yuslow.investigation

investigation.start
a_very_slow_method
investigation.finish

to your code. Execute the code and you will see output in $stdout with the following tree structure. It will help you understand which branch and method of your code has poor performance.

Thread[1]:
  Object#very_slow elapsed 1000 ms
    Object#not_my_fault elapsed 1000 ms
      Object#not_me elapsed 0 ms
      Object#root_cause elapsed 1000 ms
        Kernel#sleep elapsed 1000 ms

Parameters

Parameter Options Default Description
output false :stdout :stdout Defines how the profiling results will be presented
max_level number nil nil Specifies maximum profiling depth
debug true false false Prints debug information while profiling