Michele Costa
2017-10-03 07:51:54 UTC
Hi all,
i maintain a micro-benchmark branch
<https://github.com/costajob/app-servers#dart-async> for different
languages, where i test the hypothetical max throughput of a plain "Hello
World" HTTP server by using the wrk <https://github.com/wg/wrk> tool.
I've added Dart 1.2.4 recently and noticed its throughput is not
disappointing, but nonetheless far from the Node.js one.
With Node i used the cluster library to allow pre-forking of multiple
processes, while Dart async implementation clearly does not run in parallel.
I've read that the Dart's Isolate library should support parallelism
through a multi-threading abstraction.
The API documentation
<https://api.dartlang.org/stable/1.24.2/dart-isolate/Isolate-class.html>
for Isolate was not so helpful, since it completely lacks concrete
implementation.
I've tried to extract the parallel server code used by the Techempower
benchmarks
<https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Dart/dart-raw/server.dart>,
but i suspect something is broken here.
The Dart VM complains about the lack of a "reference" method, called to
pass the socket argument to the spawned isolates (line #30 of server.dart).
If you have any tips on how to implement a parallel server via the Isolate
library (or by using a pre-forking model like the one of Node.js) they will
be really appreciated.
Many thanks
Mike
PS - in case o pre-forking i do not want to rely on an external balancer, i
dare to use just standard library, like i didi for the other languages.
i maintain a micro-benchmark branch
<https://github.com/costajob/app-servers#dart-async> for different
languages, where i test the hypothetical max throughput of a plain "Hello
World" HTTP server by using the wrk <https://github.com/wg/wrk> tool.
I've added Dart 1.2.4 recently and noticed its throughput is not
disappointing, but nonetheless far from the Node.js one.
With Node i used the cluster library to allow pre-forking of multiple
processes, while Dart async implementation clearly does not run in parallel.
I've read that the Dart's Isolate library should support parallelism
through a multi-threading abstraction.
The API documentation
<https://api.dartlang.org/stable/1.24.2/dart-isolate/Isolate-class.html>
for Isolate was not so helpful, since it completely lacks concrete
implementation.
I've tried to extract the parallel server code used by the Techempower
benchmarks
<https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Dart/dart-raw/server.dart>,
but i suspect something is broken here.
The Dart VM complains about the lack of a "reference" method, called to
pass the socket argument to the spawned isolates (line #30 of server.dart).
If you have any tips on how to implement a parallel server via the Isolate
library (or by using a pre-forking model like the one of Node.js) they will
be really appreciated.
Many thanks
Mike
PS - in case o pre-forking i do not want to rely on an external balancer, i
dare to use just standard library, like i didi for the other languages.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.