Skip to content

Using package:http carries ~100kB cost #139

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

Closed
1 of 6 tasks
matanlurey opened this issue Nov 9, 2017 · 2 comments
Closed
1 of 6 tasks

Using package:http carries ~100kB cost #139

matanlurey opened this issue Nov 9, 2017 · 2 comments
Labels
status-blocked Blocked from making progress by another (referenced) issue type-enhancement A request for a change that isn't a bug

Comments

@matanlurey
Copy link
Contributor

matanlurey commented Nov 9, 2017

Reproduction case @ https://github.com/matanlurey/http-browser-benchmark

Significant parts:

  • Uses ~30kB more from dart:core, I assume this is use of Uri.
  • Brings in package:path (~10kB).
  • Brings in package:stack_trace (~8kB).
  • Brings in package:source_span(~6kB).
  • Brings in package:http_parser, string_scanner (~4kB combined).
  • Brings in an extra ~6kB from dart:convert.

This is an issue when trying to use this package for mobile web applications. I can't see a clear reason why I need 100kB more for simple JSON requests given that we aren't using any of the other functionality.

@nex3
Copy link
Member

nex3 commented Nov 9, 2017

I'd definitely like to get the size down as much as possible without hurting functionality. The stack_trace dependency has already been removed in #115 (on master) and #123 (on 0.11.x). I think I can get rid of the source_span and path dependencies too once dart-lang/sdk#30962 and dart-lang/sdk#30963 are fixed. I believe the code size hit from Uri will be also be vastly smaller once the changes described in dart-lang/sdk#29420 (comment) happen and the class becomes a thin shim over the browser's URL support.

@nex3 nex3 added status-blocked Blocked from making progress by another (referenced) issue type-enhancement A request for a change that isn't a bug labels Nov 9, 2017
@natebosch
Copy link
Member

Closing since this is not something we plan to push on.

source_span is no longer a dependency.

path could be dropped if we re-implement basename, but that doesn't look straightforward enough to be worthwhile.

It's unlikely we'll be able to drop the dep on http_parser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status-blocked Blocked from making progress by another (referenced) issue type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants