Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Parser can be slow #19

Closed
kneath opened this Issue · 3 comments

2 participants

@kneath
Owner

Since we're using the full SCSS parser on each call, producing a Parser object can end up being really slow. Need to look into either partial SCSS compilation, or caching the result of the parser somehow.

@kneath
Owner

Another idea I had here: write my own comment parser. That way I can just take in any LESS/SCSS/CSS files, ignore all of the rules, and just grab the comments. I'm thinking this might be a better route long term.

This was referenced
@kneath
Owner

Looks like my comment parser idea totally worked here. These aren't perfect tests, but I repeated them several times and got similar numbers.

Before

~/src/kneath/kss (old)$ time ruby -I lib -rubygems -rkss -e 'Kss::Parser.new("/Users/kneath/src/github/github/public/stylesheets/github")'

real    0m2.217s
user    0m2.135s
sys 0m0.076s

With comment parser

~/src/kneath/kss (master)$ time ruby -I lib -rubygems -rkss -e 'Kss::Parser.new("/Users/kneath/src/github/github/public/stylesheets/github")'

real    0m0.084s
user    0m0.075s
sys 0m0.008s
@kneath kneath closed this
@kneath kneath referenced this issue from a commit
@kneath 0.3.0
Includes much faster parsing (see #19) and removes the dependencies on
SASS & LESS native gems.
8e700ea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.