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

Investigate dev-mode perf issues for fumadocs #1232

Open
ssalbdivad opened this issue Dec 21, 2024 · 2 comments
Open

Investigate dev-mode perf issues for fumadocs #1232

ssalbdivad opened this issue Dec 21, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation external-contributor-friendly Doesn't rely heavily on contextual knowledge of ArkType (may still be complex)

Comments

@ssalbdivad
Copy link
Member

ssalbdivad commented Dec 21, 2024

Before migrating to fumadocs, there was a significant delay on saving a .ts file before you could see your changes reflected in browser while running pnpm dev.

Though fumadocs has been a significant improvement in many ways, this has actually substantially worsened. I recently was able to fix the --turbo flag on dev mode, but even with that enabled, I'm often seeing ~10 seconds to reload the home page and ~25 seconds on initial navigation to the docs section (down from over 50 seconds).

My best guess is somehow, twoslash is actually typechecking large portions of the repo in these cases to try and update inferred types. Typechecking the entire repo takes ~10 seconds locally, so that still doesn't account for all of it, but it's my best guess as to where to start for such extreme delays in such a small project.

Would love if someone better versed in Next.js could take a look and see if they can root cause it/find some potential improvements.

UPDATE: I did try removing twoslash and saw the compile time go from ~10s->~6sfor the homepage and ~25s->~6s for docs. Still seems pretty slow though...

@github-project-automation github-project-automation bot moved this to To do in arktypeio Dec 21, 2024
@ssalbdivad ssalbdivad added external-contributor-friendly Doesn't rely heavily on contextual knowledge of ArkType (may still be complex) documentation Improvements or additions to documentation and removed external-contributor-friendly documentation labels Dec 21, 2024
@ssalbdivad ssalbdivad moved this from To do to Backlog in arktypeio Dec 21, 2024
@fuma-nama
Copy link

I had reached out to the Next.js team about the idea of lazy bundling - only compile MDX files when Next.js runtime requests it, which will significantly reduce initial time taken for compilation under dev mode.

Turbopack is still under the "make it work" stage, so in short term we probably cannot fix the problem

@ssalbdivad
Copy link
Member Author

@fuma-nama Thanks for taking a look and for your great work on fumadocs! I have been frustrated a bit by some of Next's DX but your library has been so great it's been a big upgrade overall regardless👍

Would love to know if that ends up happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation external-contributor-friendly Doesn't rely heavily on contextual knowledge of ArkType (may still be complex)
Projects
Status: Backlog
Development

No branches or pull requests

2 participants