Closed DanielChaseButterfield closed 5 months ago
I'm encountering the exact same issue when running 'docker compose up'—it's taking me a solid 4 minutes to get my local site up and running. This delay is throwing a wrench into my workflow, especially when it comes to making quick edits and seeing them live.
My setup is pretty standard, with only minor tweaks to the base repo, so this lengthy build time seems out of the ordinary.
OS: Arch Linux x86_64 Kernel: 6.8.1-arch1-1 Shell: zsh 5.9 DE: Hyprland WM: sway CPU: AMD Ryzen 7 5700U with Radeon Graphics (16) @ 4.372GHz GPU: AMD ATI 03:00.0 Lucienne Memory: 3641MiB / 9807MiB
Check #2283 for a possible solution. Meanwhile I believe we should tackle this issue. The blog shouldn't take this long to build locally.
Can you test this solution to see if it solves your problem?
@george-gca I just tested out the following solution:
sass:
# style: compressed
sourcemap: never
It dropped the startup time from 4 minutes to 40 seconds, which was fantastic! Making changes to the repository also updates the localhost site in 25 seconds now.
I also wanted to try out the cdn import solution, but I don't currently have time to find all the cdn urls, but hopefully soon I'll be able to try it.
Leaving style: compressed
adds much to the build time?
Yes, actually. I tried running it by just adding the sourcemap: never
line, but it didn't change anything.
I theorized that by specifying the style, it made it load the sourcemap (basically overwritting the sourcemap: never
), so I commented style: compressed
out. Doing this resulted in a much faster build time.
However, I'm not familiar with sass
, so take that with a grain of salt.
The style: compressed
part removes as many extra characters as possible, and writes the entire stylesheet on a single line (as stated in the docs). It is useful for generating a compact version of the css files. One possible solution might be using what is suggested in this answer.
Can you check what other part consumes time during build? Add --profile
to the build or serve command to check what is slowing it down.
Another possible solution might be adding --incremental
, which only re-builds posts and pages that have changed. Note that it may also break site generation in certain cases.
I also met the such problem. In general, local changes should take effect quickly, right now I can only do it by restarting the container, which consumes about 30 seconds.
Same issue here, and style: compressed
dropped the time from several minutes to ~20 seconds.
Can somebody else try this and check what other part consumes time?
Can you check what other part consumes time during build? Add
--profile
to the build or serve command to check what is slowing it down.Another possible solution might be adding
--incremental
, which only re-builds posts and pages that have changed. Note that it may also break site generation in certain cases.
Ran into the same issue.
jekyll build
with style: compressed
: 268.459 secondsjekyll build
without style: compressed
: 16.828 seconds--incremental
didn't change the runtime.
Output from jekyll build --profile
with style: compressed
:
Build Process Summary:
| PHASE | TIME |
+----------+----------+
| RESET | 0.0004 |
| READ | 0.0286 |
| GENERATE | 0.0111 |
| RENDER | 2.1556 |
| CLEANUP | 0.0050 |
| WRITE | 262.8002 |
Site Render Stats:
| Filename | Count | Bytes | Time |
+-------------------------------------------------+-------+----------+-------+
| _layouts/default.liquid | 71 | 1151.22K | 0.341 |
| _includes/header.liquid | 72 | 238.71K | 0.164 |
| _includes/head.liquid | 72 | 162.80K | 0.130 |
| _pages/publications.md | 1 | 30.89K | 0.104 |
| _layouts/about.liquid | 1 | 16.03K | 0.079 |
| _includes/selected_papers.liquid | 1 | 11.22K | 0.075 |
| _layouts/post.liquid | 28 | 138.97K | 0.055 |
| feed.xml | 1 | 52.08K | 0.030 |
| _includes/metadata.liquid | 72 | 37.65K | 0.018 |
| .html | 6 | 50.26K | 0.016 |
| _posts/2023-07-12-post-bibliography.md | 1 | 0.61K | 0.012 |
| _posts/2023-07-12-post-bibliography.md/#excerpt | 1 | 0.31K | 0.011 |
| _includes/scripts/misc.liquid | 71 | 54.99K | 0.011 |
| _includes/figure.liquid | 50 | 46.56K | 0.009 |
| sitemap.xml | 1 | 6.79K | 0.006 |
| _layouts/distill.liquid | 1 | 28.89K | 0.006 |
| _includes/footer.liquid | 72 | 23.48K | 0.005 |
| _projects/1_project.md | 1 | 7.94K | 0.004 |
| _layouts/page.liquid | 9 | 80.41K | 0.004 |
| _posts/2015-05-15-images.md | 1 | 7.31K | 0.004 |
| _posts/2018-12-22-distill.md | 1 | 10.51K | 0.003 |
| _includes/scripts/masonry.liquid | 71 | 37.37K | 0.003 |
| _posts/2015-07-15-code.md | 1 | 4.36K | 0.003 |
| _includes/related_posts.liquid | 18 | 19.64K | 0.003 |
| _posts/2023-03-21-tables.md | 1 | 2.83K | 0.003 |
| _layouts/archive-tag.liquid | 19 | 18.55K | 0.002 |
| _includes/pagination.liquid | 6 | 6.79K | 0.002 |
| _includes/scripts/bootstrap.liquid | 72 | 22.99K | 0.002 |
| _posts/2023-04-24-videos.md | 1 | 2.17K | 0.002 |
| _includes/scripts/mathjax.liquid | 72 | 28.12K | 0.002 |
| _includes/scripts/badges.liquid | 71 | 11.02K | 0.002 |
| _includes/social.liquid | 1 | 0.77K | 0.002 |
| _posts/2024-01-27-advanced-images.md | 1 | 7.34K | 0.001 |
| _includes/video.liquid | 4 | 1.59K | 0.001 |
| _includes/scripts/analytics.liquid | 72 | 0.14K | 0.001 |
| _projects/5_project.md | 1 | 7.91K | 0.001 |
| _includes/scripts/jquery.liquid | 72 | 13.78K | 0.001 |
| _projects/6_project.md | 1 | 7.91K | 0.001 |
| _layouts/archive-year.liquid | 6 | 8.49K | 0.001 |
| _projects/4_project.md | 1 | 7.91K | 0.001 |
| _projects/2_project.md | 1 | 7.91K | 0.001 |
| _projects/3_project.md | 1 | 7.91K | 0.001 |
| _includes/news.liquid | 2 | 1.84K | 0.001 |
| _includes/scripts/progressBar.liquid | 72 | 209.53K | 0.001 |
| _includes/giscus.liquid | 9 | 9.24K | 0.001 |
| _layouts/archive-category.liquid | 2 | 7.32K | 0.001 |
| _includes/scripts/mermaid.liquid | 71 | 1.93K | 0.001 |
| _includes/scripts/chartjs.liquid | 71 | 0.65K | 0.001 |
| _includes/scripts/imageLayouts.liquid | 71 | 0.41K | 0.001 |
| _includes/scripts/echarts.liquid | 71 | 1.61K | 0.001 |
done in 265.009 seconds.
Since most of the time is spend in the Write
part it really is the sass
being compressed. I believe the best solution for this would be to change the bin/entry_point.sh file and add something like this answer on stackoverflow. If you manage to test this and make it work, can you send a PR? Probably for testing you will need to force the docker compose up to run a different command from the original one.
Have you checked that your issue isn't already filed?
Bug description
Running 'docker compose up' takes 4 minute to successfully generate the stie.
How to reproduce the bug
I followed all of the INSTALL.md steps under 'Recommended Approach', and my website successfully deploys to my github.io page.
Then, I followed the steps under 'Local setup using Docker (Recommended)'.
After running
docker compose up
, it takes 4 minutes to actually get the localhost website running. This makes customization and live editing incredibly difficult.It freezes between these two commands.
I have made very minimal custom changes to the repository so far, just swapping out the photo, the person's name, and some links to LinkedIn, etc. So I don't think it should be taking this long.
Error messages and logs
Here is the full execution trace:
What operating system are you using?
Not applicable (e.g. you're using GitHub Pages or other hosting)
Where are you seeing the problem on?
Running locally with Docker
More info
Note: I'm using WSL2 on Windows.