scalableminds / amd-optimize

An AMD (RequireJS) optimizer that's stream-friendly. Made for gulp.
MIT License
162 stars 29 forks source link

Remove ast from file before cloning #15

Closed c0 closed 10 years ago

c0 commented 10 years ago

Vinyl 0.3.0 introduced deep cloning of file properties. When contents of ast are included, it takes a conderable amount of time to clone it. These contents are used as a local variable and not needed.

This was detected when building a project with d3.js, which apparently has a complex ast. Time drastically reduced from 1.5 minutes to 18s.

Vinyl Change: https://github.com/wearefractal/vinyl/commit/e493187b3f2fd1485077f09e73e669407ac077d3#diff-168726dbe96b3ce427e7fedce31bb0bcR51

normanrz commented 10 years ago

Thanks for sending this PR. I added a test for it and merged/published.

c0 commented 10 years ago

:+1: thank you!

yocontra commented 10 years ago

FYI we now have the option to disable deep cloning in vinyl 0.4.1