Permalink
Browse files

Added a little tester script that highlights the problem further

  • Loading branch information...
1 parent 2c0dbd7 commit fb64333cb1d76db714b688860d679c9c2c0600ca @tmeasday committed Nov 10, 2011
Showing with 66 additions and 3 deletions.
  1. +4 −3 Gemfile
  2. +17 −0 Gemfile.lock
  3. +3 −0 config/application.rb
  4. +42 −0 script/tester.rb
View
@@ -11,12 +11,12 @@ gem 'json'
# Gems used only for assets and not required
# in production environments by default.
-group :assets do
+# group :assets do
gem 'sass-rails', '~> 3.1.4'
gem 'compass', '>= 0.12.alpha.0'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
-end
+# end
gem 'jquery-rails'
@@ -30,5 +30,6 @@ gem 'jquery-rails'
# gem 'capistrano'
# To use debugger
-# gem 'ruby-debug'
+gem 'ruby-debug19'
+gem 'ruby-prof'
View
@@ -29,6 +29,7 @@ GEM
activesupport (= 3.1.1)
activesupport (3.1.1)
multi_json (~> 1.0)
+ archive-tar-minitar (0.5.2)
arel (2.2.1)
builder (3.0.0)
chunky_png (1.2.5)
@@ -39,6 +40,7 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.1.2)
+ columnize (0.3.4)
compass (0.12.alpha.0)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
@@ -53,6 +55,8 @@ GEM
railties (~> 3.0)
thor (~> 0.14)
json (1.6.1)
+ linecache19 (0.5.12)
+ ruby_core_source (>= 0.1.4)
mail (2.3.0)
i18n (>= 0.4.0)
mime-types (~> 1.16)
@@ -87,6 +91,17 @@ GEM
rake (0.9.2)
rdoc (3.11)
json (~> 1.4)
+ ruby-debug-base19 (0.11.25)
+ columnize (>= 0.3.1)
+ linecache19 (>= 0.5.11)
+ ruby_core_source (>= 0.1.4)
+ ruby-debug19 (0.11.6)
+ columnize (>= 0.3.1)
+ linecache19 (>= 0.5.11)
+ ruby-debug-base19 (>= 0.11.19)
+ ruby-prof (0.10.8)
+ ruby_core_source (0.1.5)
+ archive-tar-minitar (>= 0.5.2)
sass (3.1.10)
sass-rails (3.1.4)
actionpack (~> 3.1.0)
@@ -118,6 +133,8 @@ DEPENDENCIES
jquery-rails
json
rails (= 3.1.1)
+ ruby-debug19
+ ruby-prof
sass-rails (~> 3.1.4)
sqlite3
uglifier (>= 1.0.3)
@@ -44,5 +44,8 @@ class Application < Rails::Application
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
+ config.assets.precompile = ['screen.css']
+
+ config.whiny_nils = false
end
end
View
@@ -0,0 +1,42 @@
+require 'sass'
+require 'compass'
+require 'benchmark'
+
+# require 'unprof'
+require 'ruby-prof'
+
+# $DEBUG=true
+
+module SassTester
+ def self.render
+ sass = open('/Users/tom/Development/Percolate/sass_rails_slowness/app/assets/stylesheets/screen.css.scss').read
+ engine= Sass::Engine.new(sass,
+ {:preferred_syntax=>:scss,
+ :syntax => :scss,
+ :style=>:expanded,
+ :cache=>true,
+ :read_cache=>true,
+ :line_comments=>true,
+ :load_paths=>['/Users/tom/Development/Percolate/sass_rails_slowness/app/assets/stylesheets',
+ '/Users/tom/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/compass-0.12.alpha.0/frameworks/blueprint/stylesheets',
+ '/Users/tom/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/compass-0.12.alpha.0/frameworks/compass/stylesheets'],
+ :cache_location=>"/Users/tom/Development/Percolate/sass_rails_slowness/tmp/sass-cache",
+ :full_exception=>true,
+ :filename=>"/Users/tom/Development/Percolate/sass_rails_slowness/app/assets/stylesheets/screen.css.scss",
+ :line=>1
+ }
+ )
+
+ out = ''
+ # RubyProf.start
+ # out << engine.render
+ puts Benchmark.measure { out << engine.render }
+ # printer = RubyProf::GraphHtmlPrinter.new(RubyProf.stop)
+ # printer.print(open('profile.html', 'w'), {:min_percent => 10})
+
+
+ out
+ end
+end
+
+# SassTester.render

0 comments on commit fb64333

Please sign in to comment.