LearnBoost/stylus — pull request #711 by kpdecker (2012-06-04 05:25:15+00:00)
Title: Import cache

Caches the AST for imported files for future reuse if `options._importCache` is defined.

This is targeted as watch and multibuild systems like lumbar that may see the same set of mostly static includes parsed numerous times. For these situations this is a huge improvement (The walmart mobile site saw a ~33% decrease in build time for development builds)

The AST for a given file is stored on this `options._importCache` if defined, keyed on the file name that generated it. Any clients utilizing this API are expected to clear this cache object manually when they detect that a give file has changed.

Example usage here: https://github.com/walmartlabs/lumbar/commit/db7393221445bc5c9b17f1ae91d43e2331e14c50
https://github.com/walmartlabs/stylus/commit/2968327a6694b36841d32dc7345e7a1e4d3c8a62