Skip to content

perf: dynamic import dev server #3689

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

Merged
merged 2 commits into from
Mar 14, 2025
Merged

perf: dynamic import dev server #3689

merged 2 commits into from
Mar 14, 2025

Conversation

boehs
Copy link
Contributor

@boehs boehs commented Mar 12, 2025

closes #3621

cpuprof showed significant time spent loading libraries for the dev server. This ensures it is only imported when needed

~/Code/small/eleventyb: hyperfine "pnpm build" --warmup 1
Benchmark 1: pnpm build
  Time (mean ± σ):     636.3 ms ±  88.6 ms    [User: 572.3 ms, System: 92.2 ms]
  Range (min … max):   582.1 ms … 878.8 ms    10 runs
// after change
~/Code/small/eleventyb: hyperfine "pnpm build" --warmup 1
Benchmark 1: pnpm build
  Time (mean ± σ):     593.4 ms ±  49.5 ms    [User: 551.8 ms, System: 88.3 ms]
  Range (min … max):   533.4 ms … 701.4 ms    10 runs

image

tested by verifying eleventy --serve still works

assuming 50ms of savings, with 60k downloads per week, eleventy is likely called 100k times per week, or 5200000 times per year. This means this change will save 72 hours of compute per year! buying puts on AMD!!!!!

@boehs boehs requested a review from zachleat as a code owner March 12, 2025 03:42
@zachleat zachleat added this to the Eleventy 3.0.1 milestone Mar 13, 2025
Copy link
Member

@zachleat zachleat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you very much!

@zachleat zachleat merged commit 6535ea2 into 11ty:main Mar 14, 2025
11 checks passed
@zachleat
Copy link
Member

Shipping with v3.0.1-alpha.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

performance yak shaving
2 participants