You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then, create a new module to populate the prerendering routes
import { readdir } from 'fs/promises';
export default defineNuxtModule({
async setup(_, nuxt) {
// Set the code highlight configurations
nuxt.options.nitro.prerender = nuxt.options.nitro.prerender {};
nuxt.options.nitro.prerender.routes = nuxt.options.nitro.prerender.routes [];
const routes = new Set(nuxt.options.nitro.prerender.routes);
const results = await readdir('./content/man');
for (const filename of results) {
routes.add('/man/' + filename.slice(0, -3));
}
nuxt.options.nitro.prerender.routes = Array.from(routes);
}
})
Describe the bug
Prerendering 2000+ markdown pages take 26s per page locally. On vercel this takes 10s per page
Adding 20ish longer documents and this becomes 10 minutes PER PAGE.
What does this mean? It means that your page generation is O(n) to the amount of content. Total prerender time is O(n^2) to the amount of content you have.
This makes nuxt-content unsuitable for anything non-trivial when you have more than 1000 documents.
Removing half the pages and the per-page rendering time reduce by half.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
Neo-Zhixing
changed the title
Prerender is O(n^2) to the number of markdown document
Prerender takes 10 minutes per page!!!
Nov 28, 2023
I'm experiencing the same problem (ref: misskey-dev/misskey-hub-next#72).
My project has 3000+ markdown documents and it takes about 30 seconds to generate each page on Cloudflare Pages.
Environment
Reproduction
To test this, download this zip file: https://neo-zhixing.github.io/vk-doc-md/dist.zip and put it in
./content/man
Then, create a new module to populate the prerendering routes
Describe the bug
Prerendering 2000+ markdown pages take 26s per page locally. On vercel this takes 10s per page
Adding 20ish longer documents and this becomes 10 minutes PER PAGE.
What does this mean? It means that your page generation is O(n) to the amount of content. Total prerender time is O(n^2) to the amount of content you have.
This makes nuxt-content unsuitable for anything non-trivial when you have more than 1000 documents.
Removing half the pages and the per-page rendering time reduce by half.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: