SteveSanderson / gulp-requirejs-bundler

Gulp plugin. Wraps gulp-requirejs and adds the ability to emit bundle files and bundle config.
MIT License
7 stars 12 forks source link

Slowness #3

Open adam-lynch opened 10 years ago

adam-lynch commented 10 years ago

Is there any way to make this faster?

I've a task which watches for changes, re-runs my bundle task, then reloads page (with browser-sync) once, but it's very slow to re-bundle. It's taking 4 / 5 seconds.

I wish it cached the contents of a file and checked it before trying to read the file & traverse its dependencies.

adam-lynch commented 10 years ago

I've looked into this a bit and it seems like r.js itself is very slow (even CLI). None of the params suggested around the web (keepBuildDir, optimize, etc.) seem to make any difference. An empty startup.js (with third-party dependencies) takes a few seconds. If I empty options.include (for gulp-requirejs-bundler) and just have jquery as a dependency to an almost empty startup.js, it still takes almost half a second to bundle it up.

Is there something I'm missing here? Or r.js just that slow? I've seen a few old issues / threads on its slowness which seem like they weren't resolved.

It's nothing to do with my gulp setup, since I reduced it down to the bare bones. And no, it's not uglify's fault :smile:.