Say I have an endpoint (I'll call it SERVICE) that returns a simple JSON string. In Dart, the following code is consistently very fast; it runs in less than a second:
main() => HttpRequest.getString(SERVICE).then(print);
However, this code is consistently about 10 times slower:
main() async => print(await HttpRequest.getString(SERVICE));
Why is this so much slower? Am I doing something wrong here?
If it matters, I'm testing this in Dartium using the simple "bare bones web application" example in WebStorm, and I get the same behavior in Chrome.
pub serve(localhost:63342) and the backend is a simple Flask app (localhost:5000). If nothing comes to mind I'll try to get a smaller repro and file a bug. - Brandon