-
Notifications
You must be signed in to change notification settings - Fork 807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow performance #49
Comments
When I'm running |
@jericopulvera try to do:
|
@JeffreyWay have you try compiling bootstrap-sass v4 because I try it and it takes a minute on my end. |
Removing "?sourceMap" in sass-loader in webpack.config.js makes my build from 60+s to 3s. |
I'm getting same issues, I branched before trying mix out. Have 1 branch compiling .scss files in 1123ms via Elixir Removing ?sourceMap didn't do much for me :( Additionally when using @JeffreyWay I could share a repo with you if you're interested to see if you can identify the reason? |
This slow performance happens to me when I run npm inside my virtual machine. |
I'm not using any form of virutialisation, straight up node from Brew |
The initial compile can be slow, but are you all using npm run watch? That should be significantly faster. |
I had hoped that, however sadly no, bother either hmr or watch modes both compile slowly, that's what my above benchmark was based on :( Would it be any use for you to see the actual files I can extract them into a repo to check? |
This is what I get on
And that's faster than it usually is for me. Most of the time I'm at the double. |
I pushed a commit that should speed up compilation a good bit. |
I have a verison of webpack.config that does NOT have what @JeffreyWay has pushed, still uses the old sass-loader, and version on npm is 0.8.1 (mine also) but on github its 0.8.0 😆 |
JeffreyWay Please help. when i try to run: npm run dev 11% building modules 9/14 modules 5 active ...onents\granted\granted-assistance .vue |
Please help, I am Stuck. when i try to run: npm run dev 11% building modules 9/14 modules 5 active ...onents\granted\granted-assistance .vue |
Hello. Here's an update since my last comment and with the newest release of Mix installed. When I run So now I run |
Just updated last night to the latest version and scss is terribly slow now. |
Wow that was easy try disabling url processing it fixed the issue for me, back to seconds compared to the painfully slow minutes it was taking before building bootstrap-sass on windows. If only I'd checked the docs earlier. All my urls are absolute and very rarely change. mix.sass('resources/assets/app/app.scss', 'public/css')
.options({
processCssUrls: false
}); |
Thanks @howdu My build went from @JeffreyWay, not sure if this information should result in a re-open? |
+1 @howdu. Thanks for your tip, you saved my day ! |
I am getting a terrible performance: DONE Compiled successfully in 17711ms :( Running the latest Homestead 2.0.0 (VM - Virtualbox) with: Any places to look for further faults? Thanks! |
Did you tried to shutdown url processing as adviced by howdu ? |
UPDATE (Solution): The only way I could make laravel-mix work FAST was like this: Main steps to follow:
Everything works fine and fast now! |
thanks @howdu 👊 |
+1 to @howdu. Fixed my lock up. |
+1 @howdu. Thanks man. You made my day! |
After upgrading from Elixir to Mix I also had very slow performance at the first compile and when watching for changes... I do have many SCSS files... Setting Big thanks to @JeffreyWay for bringing us Mix (and so many other goodies)! #respect ! |
+1 @howdu -- it went from ~2 minutes to 5 seconds or so. |
I also had to use solution by @howdu to get Mix to work in my Homebrew box (Windows host), but I think it would be better if we could get to the actual root of the issue and solve it. Perhaps this has to do with the usage of virtualization. I see many people with the same virtualized setup as mine having this issue, while others that are running it in the native OS are not. |
@rodrigogoncalves sadly not true :D We've got several native macOS machines of different spec with latest updates, and still had the issue. |
It would be great if the problem can be solved, in case we do need/want to process the images... I was actually considering this, because I would like to enable browsercaching... I'm running macOS sierra with Laravel Valet. PHP and MySQL etc. is all installed via Homebrew. So I'm not using any VM.
|
Should this ticket be closed? |
@JeffreyWay Issue seemed to have been resolved. @rodrigogoncalves Just ping him. |
@ruchern, what I mean was: "Should this ticket really be closed, or should it be open, since the issue is still not solved?" |
I think the issue is resolved in the 1.0 beta, at least when I tried it. But that wasn't versioning yet etc., so I'm waiting till the 1.0 release to use this feature. 👍 |
Is there an option (or could there be @JeffreyWay ) where the URLs can be cached for a certain amount of time? We're using some google fonts, and while of course we want to keep up with the latest version, it's pointless bandwidth and time to fetch those and recompile every time we make a change. It could certainly could be cached fr 12 or 24 hours with no major consequence when running |
@howdu thanks a lot! |
By turning of compress in mix.options (running "npm run production") I got a 50% build decrease with a 3% increase in resulting js size. No idea what the big downside is in this case. Any ideas? Take a look at the output differences below. For anyone interested in code-copy-pasting:
50% reduced compilation time
Long compilation time
|
Technically your file are so small in size that the compression ratio is not high. |
Fresh Laravel install here. Just made an npm install and tried to npm run dev with the sample files. Using the latest homestead (installed a fresh one yesterday). |
@dominiquevilain not to worry. How often do you want to compile your assets? Even on development, you are going to use the water anyway. Watch will compile for the first time and subsequently only makes delta compilations. |
@ruchern Watch task isn’t recompiling anything at all… Just added a property to the exampleComponent provided with the fresh install of Laravel, tried to use it somewhere in the component. The watch task ignores it when i save. Worth to mention that at the end of the npm install, i've got a warning about the impossibility to install fsevent on the linux used by homestead. So fsevent is not installed. I will try with a native OSX configuration instead of the homestead VM. |
Back to MacOS instead of Homestead. Everything is fast… And the Watch script works! |
@dominiquevilain , I have the same issue running a vagrant homestead Laravel box on a windows 10 host machine. I've removed all the other imports (like bootstrap) and with just maybe 200 lines of scss in all at this point. "npm run dev" takes around 15 seconds (with urls disabled) and "npm run watch" does not detect any changes to anything. It looks like it has something to do with the vagrant sharing the drive with windows and how homestead has configured a few things that don't play well with window hosts. I tried going back to my old tried and tested method of using using node-sass, concat, postcss and nodemon.js for watching and building the css and watching works as it should and it takes just a fraction of a second. I didn't have this issue with a previous project but to be honest I don't think this is the laravel-mix change but changes made to the homestead Laravel project. |
Win10, running locally, and none of the solutions worked for me (including @howdu's). Compiling always takes 15-20 seconds. |
@legshooter check if you have any .scss imports from node_modules and see if you can import .min.css instead. Might seem obvoius but still. |
@exfriend only Bootstrap. Thanks though. Update: I was up to ~54 seconds for But now my whole setup is Mix-ed, and after dropping some heavy dependencies and moving from Less to Sass, it's down to ~33 seconds.
|
This might help some having problem with getting their syntax correct with how to set uglify options as a bunch of the examples above do not work (produce errors about how compress isn't a valid option)
|
@howdu You save my day :) |
This is good but it compiles slower than laravel elixir gulp. why?
The text was updated successfully, but these errors were encountered: