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

Parallel Serialization #16

Closed
1 of 5 tasks
thescientist13 opened this issue Mar 27, 2019 · 4 comments
Closed
1 of 5 tasks

Parallel Serialization #16

thescientist13 opened this issue Mar 27, 2019 · 4 comments
Assignees
Labels
enhancement Improve something existing (e.g. no docs, new APIs, etc) v0.4.0 Plugins and Packages
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Mar 27, 2019

Type of Change

  • New Feature Request
  • Documentation / Website
  • Improvement / Suggestion
  • Bug
  • Other (please clarify below)

Summary

Currently the serialization phase runs serially, one page at a time, each page as a Promise.

const runBrowser = async (compilation) => {

  try {
    return await Promise.all(compilation.graph.map(({ route, label }) => {
      return browserRunner(`http://127.0.0.1:${PORT}${route}`, label, route, compilation.context.publicDir);
    }));
  } catch (err) {
    // eslint-disable-next-line no-console
    console.log(err);
    return false;
  }
};

It would be good to see what options there are to support running these in parallel so multiple pages could be serialized at once.

Otherwise this happens locally 😬
Screen Shot 2019-09-27 at 7 06 50 PM

Details

Something to consider is how to manage the "firehose" of creating and serializing pages. It would probably make sense to support a queue so for very large applications, hundreds and thousands of pages won't get spun up at once and potentially stall / crash the build server or local development workstation.

It should probably be a configurable value from greenwood.config.js.

@thescientist13 thescientist13 added the RFC Proposal and changes to workflows, architecture, APIs, etc label Mar 27, 2019
@thescientist13 thescientist13 added this to the MVP milestone Jul 9, 2019
@thescientist13
Copy link
Member Author

thescientist13 commented Jul 9, 2019

Also, could we replace JSDOM entirely? 🤔

@thescientist13
Copy link
Member Author

thescientist13 commented Aug 6, 2019

Seems like this would help out #141 and would allow us to remove process. setMaxListeners

@thescientist13
Copy link
Member Author

thescientist13 commented Aug 15, 2019

Wonder what our options in regard to an actual renderToString method being worked on for lit-html.

Could be an alternative to using puppeteer, though full browser rendering is pretty cool as long as we can make this change.

@thescientist13 thescientist13 added enhancement Improve something existing (e.g. no docs, new APIs, etc) and removed RFC Proposal and changes to workflows, architecture, APIs, etc labels Sep 9, 2019
@thescientist13 thescientist13 changed the title [RFC] Parallel Serialization Parallel Serialization Sep 9, 2019
@thescientist13
Copy link
Member Author

thescientist13 commented Sep 27, 2019

So looking at this again through the lens of #213 , I notice we're launching a new instance of puppeteer for every page but and then never closing it.

It would probably make sense to launch puppeteer once, and run every page through it, then close it down. This could be dragging our tests down or causing memory leaks or even just wasting system resources.

Maybe a ➕ 1 for #15 and or some sort of benchmarking?

@thescientist13 thescientist13 self-assigned this Sep 27, 2019
@thescientist13 thescientist13 removed this from TODO in 4 - Data Sources Oct 10, 2019
@thescientist13 thescientist13 added v0.4.0 Plugins and Packages enhancement Improve something existing (e.g. no docs, new APIs, etc) and removed enhancement Improve something existing (e.g. no docs, new APIs, etc) labels Oct 12, 2019
@thescientist13 thescientist13 moved this from IN REVIEW to DONE in 3 - Plugins and Packages (0.4.0) Oct 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve something existing (e.g. no docs, new APIs, etc) v0.4.0 Plugins and Packages
Projects
No open projects
Development

No branches or pull requests

1 participant