Webpack performance

Hey guys, been using sage for a few years. Its so fantastic, makes working with Wordpress make more sense!

Recently started a project using Sage 9 and its my first time using webpack. I can’t believe how slow it is to compile when a .scss files changes. I was getting 30 second compile times, I sacrificed source maps to make it 10-20 seconds now.

I don’t get it, what am I doing wrong? I know webpack does a lot more then say, Gulp, but if this is just how it is, I don’t understand why anybody would use this over near instant compile times of Sage 8’s gulp compile times. What am I missing?

1 Like
  • How are you running webpack?: On Linux, macOS or on Windows (node for Windows or WSL) or some more exotic setup like Vagrant (VirtualBox hypervisor with shared folders/CIFS mount)?
  • Is the CPU completely in use when building (all cores)?
  • Are you using a recent node version?
  • Are the source files/project on a SSD drive or on a VM shared folder/CIFS network mount?
  • I’m running webpack on node for windows
  • My cpu goes up about 10% while compiling. Not sure how to measure individual cores
  • node version is 8.9.0
  • Source files are on my laptops SSD

Ironically my JS compiles are actually quite speedy… usually less 1.5s. So I do think its specific to SASS somehow.

Does a brand new copy of Sage (without any additional changes) also take a long time to compile? Could you narrow the compile time down to a particular file or line?

Yep, just tried it out, its the same compile times on avg. Is this not normal then for other people? Does webpack have built in debugging or compile times that I could use to narrow things down?

Mines take 3-5 seconds to compile when running webpack --watch (or yarn run start). I’m on a Mac with MacOS 10.13.3, 8GB ram and SSD.

Well that’s good to know. Since I’m new at webpack, I at least now know that there is something wrong. I’ll try and figure out how to diagnose webpack. Thanks!

Well, just to follow up on this… I never could get the performance below 15s unfortunately. That’s with source maps and resolve-url turned off.

I did forget to mention that while my files are local, a vagrant machine is running and has access to those files via a shared folder. I don’t think this should in theory affect things though as I’m running node locally with files on my local hard drive. Generally my vagrant web server is a bit slower at read/write operations though.

I ended up moving my local development to a not so local solution and use a mac-mini I have around for testing and mobile app dev. After transitioning things over there my compile times have gone down to < 3s with source maps on. Maybe vagrant does affect my local files’s speeds? I can’t wait for WSL to get their disk performance figured out!

Anyway thanks for the help, just wanted to follow though