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

Add getChildPages optimization #39

Merged
merged 2 commits into from Apr 19, 2023
Merged

Add getChildPages optimization #39

merged 2 commits into from Apr 19, 2023

Conversation

healeycodes
Copy link
Contributor

@healeycodes healeycodes commented Apr 19, 2023

πŸ‘‹ @kkga

This getChildPages optimization speeds up the 10k markdown file benchmark by 20-30sec on my M1 Pro.

I traced the benchmark and saw we were spending 60sec in this function:

Screenshot 2023-04-19 at 20 58 59

We call getChildPages twice per page and end up doing duplicate work (looping the other pages).

This PR roughly halves the amount of time we spend in this function.

There are no performance benefits for small builds (e.g. docs).

As always, no pressure to merge this – just sharing for interest :)

Benchmark used

git clone https://github.com/Zettelkasten-Method/10000-markdown-files
time deno run -A --unstable main.ts --input 10000-markdown-files

@vercel
Copy link

vercel bot commented Apr 19, 2023

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
ter βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Apr 19, 2023 8:05pm

@kkga
Copy link
Owner

kkga commented Apr 19, 2023

Looks great! As always, thanks for your contribution :D

@kkga kkga merged commit 123526c into kkga:master Apr 19, 2023
4 checks passed
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.

None yet

2 participants