Feature/improve build time#79
Conversation
|
Hey @fekete965 Did you try the bun build? How long did it take? |
You are absolutely right! Last time when I used astro it was still a thing. I should have double-checked it in the documentation. I'll remove the related commit. I'm still running build time comparison. I think the caching could speed up the build time but that only for the CI. |
|
I will try a different approach using Bun for it,
|
|
@lovestaco I can hopefully present something today. The very first PR will not completely address the issue. I do not want to risk taking down production which means I will need some help from you to setup a staging environment so we can safely test the new deployment flow. I'll update my previous comment (#79 (comment)) to reflect how far we are from completing my proposal. |
|
Hey @fekete965, What I’d suggest is to first try running Before starting the build, make sure to clean everything for accurate results: rm -rf node_modules/ yarn.lock package-lock.json dist .astro/cacheSince we don’t have a staging setup right now, I don’t think that’s an option at the moment. |
Yes, that's what I was doing. I just had to fix a couple of things in my bash scripts. |
|
@lovestaco here is the summary of my trial/research: 🚀 Astro Build Benchmark Summary (Bun vs Node)This document summarizes the benchmark results comparing Astro builds using Bun (both sequentially and in parallel via CI) against a single Node build. 🧪 Test Overview
📊 Sequential Builds (Bun, Local)
⚙️ Parallel Builds (Bun, in CI)When these 10 builds run in parallel (e.g., in GitHub Actions matrix jobs), the slowest job determines the total wall time.
⚖️ Bun (Parallel) vs Node (Full Build)
🧠 Insights
📌 Summary
✅ ConclusionUsing Bun + Astro with parallelized partial builds is significantly faster in CI environments, cutting total wall time nearly in half compared to a single Node-based build. |
|
@fekete965, the report looks good, and I can see the improvement. Can you pls push the script used for testing in the scripts folder? Also, you have one merge conflict in package.json. Also how does parallel building work? Does bun by default does parallel build? cuz I dont see any changes in any files regarding the parallel. |
I'll push the changes very soon. I'll explain the changes and the idea behind them. Bun supports some kind of parallelizm but the main problem is the amount of data that needs handling. The best we can do it to build each section of the application on a separate thread using VM's. Locally we would still need to use So this is what's changed:
|
2c496da to
38b799d
Compare
…l we decide which one we prefer)
38b799d to
5525f61
Compare
|
@fekete965 Regarding your approach with the tmp folders and separate actions — that’s probably unnecessary because:
You can remove those tmp scripts, just make sure the Edit: was reading about bun here are some pointers |
I read through your current deployment flow and I think it was performing a full build every time regardless what has changed but I haven't looked at it that closely. We pretty much cut down the build time in half + since we are using bun the build time is faster as well. Why would this increase the overall runner time? 🤔 You wouldn't even to use a custom runner for the CI which should reduce cost. I'm happy to remove the scripts and use bun only, it's up to you. |
It's not doing a full rebuild every time. https://github.com/HexmosTech/FreeDevTools/actions/runs/18942069147/job/54083205984
Just check this action,
Agreed, there is one command in packege.json Guess we can have only bun switching in this PR? |
Nice!! Thanks for clarifying that! I'll make a new PR instead of bloating this up and will only change the CI action to use bun stead of node. |


Description
Fixes #54
Type of Change
Please delete options that are not relevant.
Additional Notes
Trialing out the following:
buninstead of node to install the dependencybuninstead of node to build with astro