code-dot-org/blockly — pull request #455 by Bjvanminnen (2014-03-21 17:05:48+00:00)
Title: only clear changes to require cache instead of entire thing

Between unit tests we were clearing node's cache of modules that had already been required. This was done to force us to re-require modules, as there's a bunch of code that is run when the module is loaded. However, I noticed that we were getting pretty high memory usage.

This dials back the cache invalidation to only delete from the cache those files that we'd required since loading the file. This significantly cuts down on memory usage, presumably because there were a whole bunch of core modules that were being unnecessarily loaded into memory multiple times.