requirejs-rails icon indicating copy to clipboard operation
requirejs-rails copied to clipboard

Precompiling process is considered slow

Open chenxeed opened this issue 9 years ago • 7 comments

Hi,

I used to precompile a lot and I realize that everytime i'm doing precompiling, on my site it takes around 5 minutes long to finish precompile, while before using requireJS it's only taking me less than 1mins.

I suspect the reason is that because on precompiling, it keeps regenerating all files even if it's not changed. Please correct me if I'm wrong about this.

Will be happy to discuss if there's any tweak I can do to reduce the precompile process. Thank you

chenxeed avatar Jul 28 '15 09:07 chenxeed

We're experiencing extremely slow asset precompilation also, with node reaching 99-100% cpu for the entire time, even if no js files were touched.

I'm pouring over the source now, but it's making requirejs rails next to unusable on the smaller ec2 instances that use cpu credits...

Anyone else getting this?

siassaj avatar Apr 15 '16 13:04 siassaj

+1

a2f0 avatar Jul 25 '16 22:07 a2f0

@siassaj did you ever find out what was causing it? I am seeing the same thing.

tilsammans avatar Sep 08 '17 07:09 tilsammans

@tilsammans Have you tried calling Node directly, using the generated tmp/requirejs/rjs_driver.js file?

carsomyr avatar Sep 08 '17 15:09 carsomyr

Ah, not yet. Will check that out!

tilsammans avatar Sep 08 '17 15:09 tilsammans

@tilsammans sorry, never got to the bottom of it. I switched out to webpack and it was the right thing to do.

siassaj avatar Sep 08 '17 22:09 siassaj

I think you can avoid to include "node_modules" in assetes.rb

kevinluo201 avatar May 26 '21 03:05 kevinluo201