middleman/middleman — pull request #904 by bhollis (2013-05-23 07:15:30+00:00)
Title: Cache the filtered resource list

This is a performance improvement inspired by #903 that avoids calling `Resource#ignored?` a ton. In the profiler output from that issue, `Resource#ignored?` was called almost 300,000 times! With this change, my own site's build time drops by about 10s (from 1m15s to 1m04s).

However, I have some reservations about how this is cached - it doesn't get invalidated except when the sitemap gets recomputed. That means that if you add an `ignore` rule and don't rebuild the sitemap, your ignore won't be reflected everywhere. That worries me, though all our tests pass and my site builds correctly. I tried invalidating the sitemap from `ignore`, but middleman-blog calls ignore from within a `resource_list_manipulator` which ends up creating a resource invalidation/recomputation infinite recursion.