browserify / detective

Find all calls to require() no matter how deeply nested using a proper walk of the AST

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Revert 'require' word optimization

ashaffer opened this issue · comments

@zertosh What do you think about reverting the regex optimization so that syntax-error can be removed upstream?

Giant libraries with no require calls should be noParse'd anyway, and the performance difference, while significant, is only really marginal. Whereas the performance difference gleaned by removing syntax-error upstream is asymptotic and enormous.

IMO the bundle time of incremental re-builds is more important than one off full rebuilds, since incrementals are executed constantly (and also could be cached by browserify-incremental if you wanted).

I'm requesting this per your comment in this thread:

browserify/browserify#1208 (comment)

If you did this and merged in your sm-fast branch, we could have really awesome rebuild times I think.

Incremental rebuilds already get the benefit of skipping syntax-error. You'd be surprised how many do not noParse giant libs. But, giant libs are usually derequired or minified, so they benefit from the regex optimization more than the cost of syntax-error.

I haven't worked on sm-fast recently. I'll try to take it up this weekend. It's more complicated than it seems. It requires substantive changes to browser-pack, which result in slightly different source map output (mostly related to empty lines in the prelude and the line used by the module wrapper). But the changes don't end there. insert-module-globals also does source map concating, so it should use the same lib as browser-pack.