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

Performance #245

Open
9 tasks
lastmjs opened this issue Dec 24, 2019 · 0 comments
Open
9 tasks

Performance #245

lastmjs opened this issue Dec 24, 2019 · 0 comments

Comments

@lastmjs
Copy link
Owner

lastmjs commented Dec 24, 2019

  • Add gzip support
  • HTTP2 server push
    • This might be the way to make HTTP2 at least as efficient as bundling, thereby obsoleting bundlers. If push allows us to send all assets that we need for a request at once, then imagine the efficiency gains. How we do this would be by analyzing the dependency graph of the current script being requested. This would only work for es modules, but I think that is the future and that is okay. There are tools available I believe that will allow us to get all of the dependency information that we need for a module. We could then grab and transpile all of the dependencies, and server push them to the client, thus hopefully saving many round-trips as the browser does not have to request files individually as the module is being parsed and its dependencies fetched on the client. One problem I see is that HTTP2 is not currently supported by this library. This library is just HTTP1, assuming that you'll have some kind of other wrapper to provide HTTP2/SSL support. That works really well with Dokku...but we might just have to change that and make this thing production ready stand-alone. This could be it. We should run benchmarks to prove its efficiency, and read through and disprove all of the articles that say HTTP2 does not obsolete bundling (most specifically I'm thinking about the Khan Academy article).
    • Actually, as long as we can set the HTTP2 push headers from an HTTP1 server, which Zwitterion is currently, then we can probably keep Zwitterion a simple HTTP server. That would require that people use an HTTP2 proxy to Zwitterion... We'll have to think about the best thing to do. I like the modularity and loose coupling that Zwitterion is currently, but it might be very inconvenient for people to have to set up their own HTTP2 proxy server. Look for existing projects that could make this easier for people.
    • I don't think we need to worry about this, since the static build will be used for production...perhaps come back to this in the future if it comes up, but the server is just for development...actually, maybe the static build could grab all of the imports and create a file that should be used to create an HTTP2 push header...yes, look into that
  • Metrics for HTTP2 with bundling, versus no bundling, versus server push
    • We need to prove that Zwitterion is performant before we can truly say it is better than Webpack in most situations.
  • Write article analyzing performance
    • Find a real world application with hundreds to thousands of es modules. Determine appropriate metrics for performance testing. Test multiple types of bundled code. Test statically built code with all http2 stuff, service workers, etc. If results are favorable, write article and promote results. Let Kent Dodds know
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

1 participant