ezekg / sass-prof

A code profiler for Sass libraries
MIT License
25 stars 1 forks source link

Measure memory/space usage #6

Open ezekg opened 9 years ago

chriseppstein commented 9 years ago

This is tricky.

MRI let's you get the size of an object: http://ruby-doc.org/stdlib-2.1.0/libdoc/objspace/rdoc/ObjectSpace.html#method-c-memsize_of

You could measure the size of the AST at various points during processing.

You can measure the size of the environment during the perform step.

https://github.com/sass/sass/blob/stable/lib/sass/environment.rb is where most of the accumulated information about a Sass file is kept during the perform step.