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

Pre rendering very slow and memory expensive #1463

Open
Debdut opened this issue Oct 30, 2020 · 2 comments
Open

Pre rendering very slow and memory expensive #1463

Debdut opened this issue Oct 30, 2020 · 2 comments

Comments

@Debdut
Copy link

Debdut commented Oct 30, 2020

Reproduction

Please try building this repo

Steps to reproduce

I am building with pre-render about 1000 pages.

preact build --prerenderUrls ./prerender.js

Expected Behavior

I expect 1K pages rendering to take significantly less time and less memory.

Actual Behavior

When I try to build on a 2GB memory container, it fails with Out of Memory Error (Exit Status 137). It takes about 1 hr on 4GB machine with 4 vCPUs to build.

As it seems from the building process, preact build all of the files in memory first and then emits them, instead of emitting one by one and clearing the memory in process. This probably leads to such high memory usage.

On similar pre-rendering frameworks like react-static and Gatsby it takes about 5 min each for the same job.

I love Preact but it seems I won't be able to scale the pre-rendering for my site with it.

@ForsakenHarmony ForsakenHarmony transferred this issue from preactjs/preact Oct 30, 2020
@prateekbh
Copy link
Member

opened an rfc #1482 regarding this

@LionsAd
Copy link

LionsAd commented Apr 10, 2022

Unfortunately the experimental renderer never did make it in, but if someone still needs fast prerender.js script:

#1684 (comment)

@rschristian rschristian mentioned this issue Jul 8, 2022
Merged
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

3 participants