substack/node-browserify — pull request #103 by jacwright (2012-01-12 18:56:39+00:00)
Title: Increase compile speed for most scripts.

The biggest pain with browserify is the speed of compile during development. When changing a file one must wait for a compile to finish before refreshing the browser to test.

This is an attempt to address the speed of browserify as defined in issue 90: https://github.com/substack/node-browserify/issues/90.

The bottle-neck is the AST conversion and walking to pull out require statements. Using a simple regular expression to find all require statements drastically improves the speed for regular (non-uglified) compiles. This will make development using browserify much less painful.

The regular expression may need a little tweaking to ensure it matches appropriately against all cases, however this is a good place to start from. Any ideas for making this better are welcome. Any pointers on why this is not a viable solution are also welcome.