Project

sass-prof

0.01
Repository is archived
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Sass Prof is a code profiler for Sass. For each function, Sass Prof will show the execution time for the function, which file called it and what arguments were given when the function was called.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.9
~> 1.0
~> 10.0

Runtime

~> 3.4
 Project Readme

Sass Prof

Gem

Sass Prof

Sass Prof is a code profiler for Sass. For each @function, @mixin, @include and $variable, Sass Prof will show its execution time, which file called it and what arguments were given when it was called. Currently, @extend is not supported but it is a planned feature.

Requirements

  • Sass ~> 3.4.0

Installation

  1. Install with gem install sass-prof
  2. If you're using Compass, add require "sass-prof" to your config.rb
  3. Sass Prof will automatically run next time you compile
  4. That's it!

Uninstall

  1. Remove the line require "sass-prof" from your config.rb

Usage

You may specify a few options within your config.rb, such as ignoring certain actions or directing output to a log file.

require "sass-prof"

# Configuration object
prof = SassProf::Config

# Directs all output to a log file
# Default is `false`
prof.output_file = "sass-prof.log"

# Adjust max column width
# Default is `false`
prof.max_width = 40

# Mutes all output to stdout
# Default is `false`
prof.quiet = true

# Maximum execution time allowed in ms
# Default is `100`
prof.t_max = 500

# Alias for `t_max`
prof.max_execution_time = 15

# Enable colored output
# Default is `true`
prof.color = true

# Execution time floating point precision
# Default is `15`
prof.precision = 5

# Ignore certain action types during profile
# Default is `[]`
prof.ignore = [
  :fundef,
  :fun,
  :mixdef,
  :mix,
  :var,
]

# Alias for `ignore`
prof.ignore_actions = []

Please note: your compile times will be slower due to the overhead of Sass Prof, but I've tried to be as accurate as possible in the measurements. This library was created to help you find potential bottlenecks within your code, so I hope it succeeds in that regard. If you find any bugs or inconsistencies, please file an issue or pull request.

Contributing

  1. Fork it ( https://github.com/ezekg/sass-prof/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request