Performance Bug from Expanding Nil #124

Closed
yfeldblum opened this Issue Jun 26, 2011 · 0 comments

Projects

None yet

2 participants

@yfeldblum

The following is slow in Rails development:

https://github.com/nex3/sass/blob/3.1.1/lib/sass/importers/filesystem.rb#L130

The reason is that it is called often but usually returns nil. This is a problem with Ruby (http://redmine.ruby-lang.org/issues/4917), but Sass can avoid the problem by splitting up the line and returning early before trying to expand nil (yes it's a hack, but it avoids a performance bug).

real_file = find_real_file(dir, name)
return unless real_file
full_filename, syntax = real_file
@nex3 nex3 added a commit that closed this issue Aug 21, 2012
@nex3 nex3 Fix a Rails perf issue.
Closes #124.
527e2f4
@nex3 nex3 closed this in 527e2f4 Aug 21, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment