Skip to content
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

performance yak shaving #3621

Open
boehs opened this issue Jan 17, 2025 · 1 comment
Open

performance yak shaving #3621

boehs opened this issue Jan 17, 2025 · 1 comment

Comments

@boehs
Copy link

boehs commented Jan 17, 2025

Hi, I was doing a little cpu profiling as one does when they have nothing better to do,

dev server

and I noticed that 11ty seems to be burning precious milliseconds on loading the development server even when the serve command is not called.

I noticed that 50-60ms appears to be in (anonymous server.js:1) (file:///Users/evan/Code/site/node_modules/.pnpm/@[email protected]/node_modules/@11ty/eleventy-dev-server/server.js:1:1)

The command I did was node --cpu-prof ./node_modules/@11ty/eleventy/cmd.cjs --quiet, so no dev server should have launched, and indeed none did, but node still spent time loading it due to the top level import. await import(ing would save 50-60ms or so. Amazing!!

micromatch and fast-glob

it appears 11ty is using two glob libraries for some reason? each one of them takes between 10-15ms to load, so that much would be saved by only using one

maybe the micromatch direct dep can be removed but it won't impact perf because fast-glob uses it

thank you for attending my ted talk. god bless 11ty.

@Ryuno-Ki
Copy link
Contributor

On glob dependency: #3167

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

No branches or pull requests

2 participants