diff --git a/.idea/runConfigurations/performance__hello__raw.xml b/.idea/runConfigurations/performance__hello__raw.xml new file mode 100644 index 00000000..a13c2280 --- /dev/null +++ b/.idea/runConfigurations/performance__hello__raw.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index b7eb8194..56a70f18 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,28 +2,12 @@ - - - - - - - + + + + - - - - - - - - - - - - - @@ -47,11 +31,21 @@ + + + + + + + + + + - + @@ -71,12 +65,65 @@ - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -176,12 +223,9 @@ @@ -352,7 +402,7 @@ - + - + @@ -522,6 +572,7 @@ + @@ -564,7 +615,7 @@ - + 1481237183504 @@ -748,7 +799,21 @@ - @@ -784,7 +849,7 @@ - @@ -805,7 +870,7 @@ - + @@ -831,7 +896,6 @@ - @@ -855,34 +919,15 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -1130,14 +1175,6 @@ - - - - - - - - @@ -1206,17 +1243,6 @@ - - - - - - - - - - - @@ -1251,16 +1277,6 @@ - - - - - - - - - - @@ -1273,8 +1289,71 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/performance/hello/angel.md b/performance/hello/angel.md new file mode 100644 index 00000000..e231e08c --- /dev/null +++ b/performance/hello/angel.md @@ -0,0 +1,62 @@ +# Angel Results +5 consecutive trials run on a Windows 10 box with 4GB RAM, and several programs open in the background. + +Setup: +* Angel framework `1.0.8` +* Running `wrk` 4.0.2.2 +* 2 threads +* 256 connections +* 30 seconds + +Average: +* `11070.18` req/sec +* `11.86` ms latency + +``` +tobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$ wrk -c 256 -d 30 -t 2 http://localhost:3000 +Running 30s test @ http://localhost:3000 + 2 threads and 256 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 12.23ms 7.56ms 206.05ms 93.09% + Req/Sec 5.48k 761.94 7.18k 87.50% + 324822 requests in 30.06s, 62.88MB read +Requests/sec: 10806.24 +Transfer/sec: 2.09MB +tobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$ wrk -c 256 -d 30 -t 2 http://localhost:3000 +Running 30s test @ http://localhost:3000 + 2 threads and 256 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 11.06ms 4.88ms 134.86ms 78.68% + Req/Sec 5.98k 539.40 7.50k 91.40% + 356355 requests in 30.11s, 68.99MB read +Requests/sec: 11836.11 +Transfer/sec: 2.29MB +tobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$ wrk -c 256 -d 30 -t 2 http://localhost:3000 +Running 30s test @ http://localhost:3000 + 2 threads and 256 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 12.03ms 6.18ms 159.93ms 87.89% + Req/Sec 5.52k 0.88k 7.32k 90.31% + 327749 requests in 30.06s, 63.45MB read +Requests/sec: 10901.35 +Transfer/sec: 2.11MB +tobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$ wrk -c 256 -d 30 -t 2 http://localhost:3000 +Running 30s test @ http://localhost:3000 + 2 threads and 256 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 12.92ms 7.06ms 189.00ms 82.48% + Req/Sec 5.12k 1.00k 6.42k 75.59% + 302273 requests in 30.05s, 58.52MB read +Requests/sec: 10059.96 +Transfer/sec: 1.95MB +tobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$ wrk -c 256 -d 30 -t 2 http://localhost:3000 +Running 30s test @ http://localhost:3000 + 2 threads and 256 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 11.05ms 4.92ms 104.90ms 69.57% + Req/Sec 5.95k 0.87k 7.65k 76.80% + 352798 requests in 30.03s, 68.30MB read +Requests/sec: 11747.23 +Transfer/sec: 2.27MB +tobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$ +``` \ No newline at end of file diff --git a/performance/hello/raw.dart b/performance/hello/raw.dart new file mode 100644 index 00000000..6fb20f5d --- /dev/null +++ b/performance/hello/raw.dart @@ -0,0 +1,28 @@ +/// A basic server that prints "Hello, world!" +library performance.hello; + +import 'dart:io'; +import 'dart:isolate'; + +main() { + for (int i = 0; i < Platform.numberOfProcessors - 1; i++) + Isolate.spawn(start, i + 1); + start(0); +} + +void start(int id) { + HttpServer + .bind(InternetAddress.LOOPBACK_IP_V4, 3000, shared: true) + .then((server) { + print( + 'Instance #$id listening at http://${server.address.address}:${server.port}'); + + server.listen((request) { + if (request.uri.path == '/') { + request.response.write('Hello, world!'); + } + + request.response.close(); + }); + }); +} diff --git a/performance/hello/raw.md b/performance/hello/raw.md new file mode 100644 index 00000000..0027da54 --- /dev/null +++ b/performance/hello/raw.md @@ -0,0 +1,60 @@ +# `dart:io` Results +5 consecutive trials run on a Windows 10 box with 4GB RAM, and several programs open in the background. + +Setup: +* Running `wrk` 4.0.2.2 +* 2 threads +* 256 connections +* 30 seconds + +Average: +* `14598.16` req/sec +* `8.88` ms latency + +``` +tobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$ wrk -c 256 -d 30 -t 2 http://localhost:3000 +Running 30s test @ http://localhost:3000 + 2 threads and 256 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 9.67ms 8.19ms 202.28ms 96.17% + Req/Sec 7.15k 1.47k 9.97k 73.76% + 417716 requests in 30.07s, 82.06MB read +Requests/sec: 13892.50 +Transfer/sec: 2.73MB +tobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$ wrk -c 256 -d 30 -t 2 http://localhost:3000 +Running 30s test @ http://localhost:3000 + 2 threads and 256 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 8.47ms 3.14ms 100.77ms 65.40% + Req/Sec 7.61k 670.47 8.85k 73.88% + 453301 requests in 30.07s, 89.05MB read +Requests/sec: 15077.15 +Transfer/sec: 2.96MB +tobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$ wrk -c 256 -d 30 -t 2 http://localhost:3000 +Running 30s test @ http://localhost:3000 + 2 threads and 256 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 8.62ms 3.51ms 73.34ms 63.74% + Req/Sec 7.52k 650.22 8.91k 79.17% + 448445 requests in 30.07s, 88.10MB read +Requests/sec: 14911.53 +Transfer/sec: 2.93MB +tobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$ wrk -c 256 -d 30 -t 2 http://localhost:3000 +Running 30s test @ http://localhost:3000 + 2 threads and 256 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 8.75ms 3.51ms 70.50ms 64.53% + Req/Sec 7.41k 825.50 10.23k 72.24% + 441338 requests in 30.09s, 86.70MB read +Requests/sec: 14665.62 +Transfer/sec: 2.88MB +tobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$ wrk -c 256 -d 30 -t 2 http://localhost:3000 +Running 30s test @ http://localhost:3000 + 2 threads and 256 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 8.90ms 3.62ms 78.36ms 66.71% + Req/Sec 7.31k 742.11 10.79k 77.84% + 434674 requests in 30.09s, 85.39MB read +Requests/sec: 14443.98 +Transfer/sec: 2.84MB +``` \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 344c0dd4..0a336817 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: angel_framework -version: 1.0.7+2 +version: 1.0.8 description: A high-powered HTTP server with DI, routing and more. author: Tobe O homepage: https://github.com/angel-dart/angel_framework