Selaa lähdekoodia

New actix-raw benchmarks (#3767)

* add actix-raw benchmark

* raw db benchmarks

* update actix-web version

* fix fortune benchmark

* update display names and classification
Nikolay Kim 7 vuotta sitten
vanhempi
commit
737fe1b39a

+ 120 - 63
frameworks/Rust/actix/Cargo.lock

@@ -1,24 +1,3 @@
-[[package]]
-name = "actix"
-version = "0.5.0"
-dependencies = [
- "actix 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "actix-web 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "askama 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "bytes 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "diesel 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
- "http 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "postgres 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.55 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.55 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-core 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-io 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "actix"
 version = "0.5.7"
@@ -30,7 +9,7 @@ dependencies = [
  "crossbeam-channel 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "skeptic 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "smallvec 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -41,9 +20,30 @@ dependencies = [
  "uuid 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "actix"
+version = "0.6.0"
+dependencies = [
+ "actix 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "actix-web 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "askama 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bytes 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "diesel 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
+ "http 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "postgres 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_json 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tokio-core 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tokio-io 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "actix-web"
-version = "0.6.7"
+version = "0.6.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "actix 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -62,7 +62,7 @@ dependencies = [
  "httparse 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "mime 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "mime_guess 2.0.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -72,7 +72,7 @@ dependencies = [
  "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.55 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_json 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_urlencoded 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -134,7 +134,7 @@ dependencies = [
  "askama_shared 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "syn 0.13.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -154,7 +154,7 @@ dependencies = [
  "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -166,7 +166,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "backtrace-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
  "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -177,7 +177,7 @@ version = "0.1.16"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -248,8 +248,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.55 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.55 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_json 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -263,6 +263,14 @@ name = "cfg-if"
 version = "0.1.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
+[[package]]
+name = "cloudabi"
+version = "0.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "constant_time_eq"
 version = "0.1.3"
@@ -552,7 +560,7 @@ name = "hostname"
 version = "0.1.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
  "winutil 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -595,7 +603,7 @@ name = "iovec"
 version = "0.1.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -647,7 +655,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "libc"
-version = "0.2.40"
+version = "0.2.41"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -686,7 +694,7 @@ name = "memchr"
 version = "1.0.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -694,7 +702,7 @@ name = "memchr"
 version = "2.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -731,7 +739,7 @@ dependencies = [
  "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "net2 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -745,7 +753,7 @@ version = "0.6.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
  "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -766,7 +774,7 @@ version = "0.2.32"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -788,7 +796,7 @@ name = "num_cpus"
 version = "1.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -813,7 +821,7 @@ name = "parking_lot_core"
 version = "0.2.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "smallvec 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -925,6 +933,14 @@ dependencies = [
  "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "proc-macro2"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "pulldown-cmark"
 version = "0.1.2"
@@ -959,13 +975,21 @@ dependencies = [
  "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "quote"
+version = "0.6.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "proc-macro2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "rand"
 version = "0.3.22"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -975,13 +999,30 @@ version = "0.4.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "rand"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand_core 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "rand_core"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
 [[package]]
 name = "redox_syscall"
-version = "0.1.37"
+version = "0.1.38"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -1055,7 +1096,7 @@ version = "0.9.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.55 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -1065,17 +1106,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "serde"
-version = "1.0.55"
+version = "1.0.59"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "serde_derive"
-version = "1.0.55"
+version = "1.0.59"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "syn 0.13.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "quote 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syn 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -1085,7 +1126,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "itoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.55 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -1095,7 +1136,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "itoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.55 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)",
  "url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -1151,7 +1192,7 @@ version = "0.3.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -1196,7 +1237,7 @@ dependencies = [
 
 [[package]]
 name = "syn"
-version = "0.13.10"
+version = "0.13.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1204,6 +1245,16 @@ dependencies = [
  "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "syn"
+version = "0.14.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "proc-macro2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "quote 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "synom"
 version = "0.11.3"
@@ -1244,8 +1295,8 @@ name = "time"
 version = "0.1.40"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
+ "redox_syscall 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -1280,7 +1331,7 @@ version = "0.1.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
  "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
  "mio-uds 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "tokio-core 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1488,7 +1539,7 @@ dependencies = [
 
 [metadata]
 "checksum actix 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)" = "7f01f05bfb6e77d47a04752efdac401e0e20b49130ac673cde367cda8eb7c92c"
-"checksum actix-web 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "ed40e344fc684ad0aeae72effef4f0d1a900daeacf59681a686518550103409b"
+"checksum actix-web 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "d6de46bd20bb574f38e17105c269e7b5c0cc59ce6d24b275d66931eac52dd844"
 "checksum actix_derive 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c4b1dc922654b9aca7a8a31eab875fde804fa9fbd67f220f2e457787b23590f2"
 "checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4"
 "checksum arrayref 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "0fd1479b7c29641adbd35ff3b5c293922d696a92f25c8c975da3e0acbc87258f"
@@ -1511,6 +1562,7 @@ dependencies = [
 "checksum cargo_metadata 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6ebd6272a2ca4fd39dbabbd6611eb03df45c2259b3b80b39a9ff8fbdcf42a4b3"
 "checksum cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "0ebb87d1116151416c0cf66a0e3fb6430cccd120fd6300794b4dfaa050ac40ba"
 "checksum cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "405216fd8fe65f718daa7102ea808a946b6ce40c742998fbfd3463645552de18"
+"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
 "checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e"
 "checksum cookie 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "746858cae4eae40fff37e1998320068df317bc247dc91a67c6cfa053afdc2abb"
 "checksum crossbeam-channel 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9d7b07a3084d8718d95338443d5a46aab38ce16d5f991d4027a0906b369f70a3"
@@ -1560,7 +1612,7 @@ dependencies = [
 "checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73"
 "checksum lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d"
 "checksum lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a6f08839bc70ef4a3fe1d566d5350f519c5912ea86be0df1740a7d247c7fc0ef"
-"checksum libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)" = "6fd41f331ac7c5b8ac259b8bf82c75c0fb2e469bbf37d2becbba9a6a2221965b"
+"checksum libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)" = "ac8ebf8343a981e2fa97042b14768f02ed3e1d602eac06cae6166df3c8ced206"
 "checksum linked-hash-map 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7860ec297f7008ff7a1e3382d7f7e1dcd69efc94751a2284bafc3d013c2aa939"
 "checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2"
 "checksum lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4d06ff7ff06f729ce5f4e227876cb88d10bc59cd4ae1e09fbb2bde15c850dc21"
@@ -1592,14 +1644,18 @@ dependencies = [
 "checksum pq-sys 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "9323a6ce484fc41174d40f80ba87af6247f86a7ba57856af68d3aa0c8642d2f0"
 "checksum proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cd07deb3c6d1d9ff827999c7f9b04cdfd66b1b17ae508e14fe47b620f2282ae0"
 "checksum proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1b06e2f335f48d24442b35a19df506a835fb3547bc3c06ef27340da9acf5cae7"
+"checksum proc-macro2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a45f2f0ae0b5757f6fe9e68745ba25f5246aea3598984ed81d013865873c1f84"
 "checksum pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d6fdf85cda6cadfae5428a54661d431330b312bc767ddbc57adbedc24da66e32"
 "checksum quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eda5fe9b71976e62bc81b781206aaa076401769b2143379d3eb2118388babac4"
 "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
 "checksum quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1eca14c727ad12702eb4b6bfb5a232287dcf8385cb8ca83a3eeaf6519c44c408"
 "checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8"
+"checksum quote 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9e53eeda07ddbd8b057dde66d9beded11d0dfda13f0db0769e6b71d6bcf2074e"
 "checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1"
 "checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5"
-"checksum redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "0d92eecebad22b767915e4d529f89f28ee96dbbf5a4810d2b844373f136417fd"
+"checksum rand 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a89abf8d34faf9783692392dca7bcdc6e82fa84eca86ccb6301ec87f3497185"
+"checksum rand_core 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1b7a5f27547c49e5ccf8a586db3f3782fd93cf849780b21853b9d981db203302"
+"checksum redox_syscall 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)" = "0a12d51a5b5fd700e6c757f15877685bfa04fd7eb60c108f01d045cafa0073c2"
 "checksum regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75ecf88252dce580404a22444fc7d626c01815debba56a7f4f536772a5ff19d3"
 "checksum regex-syntax 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8f1ac0f60d675cc6cf13a20ec076568254472551051ad5dd050364d70671bf6b"
 "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5"
@@ -1611,8 +1667,8 @@ dependencies = [
 "checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
 "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
 "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
-"checksum serde 1.0.55 (registry+https://github.com/rust-lang/crates.io-index)" = "97f6a6c3caba0cf8f883b53331791036404ce3c1bd895961cf8bb2f8cecfd84b"
-"checksum serde_derive 1.0.55 (registry+https://github.com/rust-lang/crates.io-index)" = "f51b0ef935cf8a41a77bce553da1f8751a739b7ad82dd73669475a22e6ecedb0"
+"checksum serde 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)" = "2a4d976362a13caad61c38cf841401d2d4d480496a9391c3842c288b01f9de95"
+"checksum serde_derive 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)" = "94bb618afe46430c6b089e9b111dc5b2fcd3e26a268da0993f6d16bea51c6021"
 "checksum serde_json 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "f3ad6d546e765177cf3dded3c2e424a8040f870083a0e64064746b958ece9cb1"
 "checksum serde_urlencoded 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e703cef904312097cfceab9ce131ff6bbe09e8c964a0703345a5f49238757bc1"
 "checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d"
@@ -1627,7 +1683,8 @@ dependencies = [
 "checksum stringprep 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1"
 "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad"
 "checksum syn 0.12.15 (registry+https://github.com/rust-lang/crates.io-index)" = "c97c05b8ebc34ddd6b967994d5c6e9852fa92f8b82b3858c39451f97346dcce5"
-"checksum syn 0.13.10 (registry+https://github.com/rust-lang/crates.io-index)" = "77961dcdac942fa8bc033c16f3a790b311c8a27d00811b878ebd8cf9b7ba39d5"
+"checksum syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)" = "14f9bf6292f3a61d2c716723fdb789a41bbe104168e6f496dc6497e531ea1b9b"
+"checksum syn 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "99d991a9e7c33123925e511baab68f7ec25c3795962fe326a2395e5a42a614f0"
 "checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6"
 "checksum synstructure 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3a761d12e6d8dcb4dcf952a7a89b475e3a9d69e4a69307e01a470977642914bd"
 "checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8"

+ 10 - 2
frameworks/Rust/actix/Cargo.toml

@@ -1,12 +1,20 @@
 [package]
 name = "actix"
-version = "0.5.0"
+version = "0.6.0"
 build = "build.rs"
 
 [[bin]]
 name = "actix"
 path = "src/main.rs"
 
+[[bin]]
+name = "actix-raw"
+path = "src/main_raw.rs"
+
+[[bin]]
+name = "actix-raw-db"
+path = "src/main_raw_db.rs"
+
 [[bin]]
 name = "actix-diesel"
 path = "src/main_diesel.rs"
@@ -20,7 +28,7 @@ askama = "0.6"
 serde = "1.0"
 serde_json = "1.0"
 serde_derive = "1.0"
-rand = "0.4"
+rand = "0.5"
 bytes = "0.4"
 num_cpus = "1.0"
 futures = "0.1"

+ 1 - 1
frameworks/Rust/actix/actix-diesel.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.25
+FROM rust:1.26
 
 ADD ./ /actix
 WORKDIR /actix

+ 1 - 1
frameworks/Rust/actix/actix-pg.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.25
+FROM rust:1.26
 
 ADD ./ /actix
 WORKDIR /actix

+ 9 - 0
frameworks/Rust/actix/actix-raw-db.dockerfile

@@ -0,0 +1,9 @@
+FROM rust:1.26
+
+ADD ./ /actix
+WORKDIR /actix
+
+RUN cargo clean
+RUN RUSTFLAGS="-C target-cpu=native" cargo build --release
+
+CMD ./target/release/actix-raw-db

+ 9 - 0
frameworks/Rust/actix/actix-raw.dockerfile

@@ -0,0 +1,9 @@
+FROM rust:1.26
+
+ADD ./ /actix
+WORKDIR /actix
+
+RUN cargo clean
+RUN RUSTFLAGS="-C target-cpu=native" cargo build --release
+
+CMD ./target/release/actix-raw

+ 1 - 1
frameworks/Rust/actix/actix.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.25
+FROM rust:1.26
 
 ADD ./ /actix
 WORKDIR /actix

+ 41 - 3
frameworks/Rust/actix/benchmark_config.json

@@ -15,7 +15,45 @@
       "webserver": "actix-web",
       "os": "Linux",
       "database_os": "Linux",
-      "display_name": "actix",
+      "display_name": "Actix",
+      "notes": "",
+      "versus": ""
+    },
+    "raw": {
+      "fortune_url": "/fortune",
+      "json_url": "/json",
+      "plaintext_url": "/plaintext",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Platform",
+      "database": "Postgres",
+      "framework": "actix",
+      "language": "Rust",
+      "orm": "Raw",
+      "platform": "None",
+      "webserver": "actix-web",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "Actix [raw]",
+      "notes": "",
+      "versus": ""
+    },
+    "raw-db": {
+      "db_url": "/db",
+      "query_url": "/queries?q=",
+      "update_url": "/updates?q=",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Platform",
+      "database": "Postgres",
+      "framework": "actix",
+      "language": "Rust",
+      "orm": "Raw",
+      "platform": "None",
+      "webserver": "actix-web",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "Actix [pg-raw]",
       "notes": "",
       "versus": ""
     },
@@ -35,7 +73,7 @@
       "webserver": "actix-web",
       "os": "Linux",
       "database_os": "Linux",
-      "display_name": "actix-diesel",
+      "display_name": "Actix [Diesel]",
       "notes": "",
       "versus": ""
     },
@@ -55,7 +93,7 @@
       "webserver": "actix-web",
       "os": "Linux",
       "database_os": "Linux",
-      "display_name": "actix-pg",
+      "display_name": "Actix [Postgres]",
       "notes": "",
       "versus": ""
     }

+ 154 - 0
frameworks/Rust/actix/src/db_pg.rs

@@ -0,0 +1,154 @@
+use actix::prelude::*;
+use postgres::{Connection, TlsMode};
+use rand::{thread_rng, Rng, ThreadRng};
+use std::io;
+
+use models::{Fortune, World};
+
+/// Postgres interface
+pub struct PgConnection {
+    conn: Connection,
+    rng: ThreadRng,
+}
+
+impl Actor for PgConnection {
+    type Context = SyncContext<Self>;
+}
+
+impl PgConnection {
+    pub fn new(db_url: &str) -> PgConnection {
+        let conn = Connection::connect(db_url, TlsMode::None)
+            .expect(&format!("Error connecting to {}", db_url));
+        PgConnection {
+            conn,
+            rng: thread_rng(),
+        }
+    }
+}
+
+unsafe impl Send for PgConnection {}
+
+pub struct RandomWorld;
+
+impl Message for RandomWorld {
+    type Result = io::Result<World>;
+}
+
+impl Handler<RandomWorld> for PgConnection {
+    type Result = io::Result<World>;
+
+    fn handle(&mut self, _: RandomWorld, _: &mut Self::Context) -> Self::Result {
+        let random_world = self
+            .conn
+            .prepare_cached("SELECT id, randomnumber FROM world WHERE id=$1")
+            .unwrap();
+
+        let random_id = self.rng.gen_range::<i32>(1, 10_000);
+        let rows = &random_world.query(&[&random_id]).unwrap();
+        let row = rows.get(0);
+        Ok(World {
+            id: row.get(0),
+            randomnumber: row.get(1),
+        })
+    }
+}
+
+pub struct RandomWorlds(pub u16);
+
+impl Message for RandomWorlds {
+    type Result = io::Result<Vec<World>>;
+}
+
+impl Handler<RandomWorlds> for PgConnection {
+    type Result = io::Result<Vec<World>>;
+
+    fn handle(&mut self, msg: RandomWorlds, _: &mut Self::Context) -> Self::Result {
+        let random_world = self
+            .conn
+            .prepare_cached("SELECT id, randomnumber FROM world WHERE id=$1")
+            .unwrap();
+
+        let mut worlds = Vec::with_capacity(msg.0 as usize);
+        for _ in 0..msg.0 {
+            let w_id: i32 = self.rng.gen_range(1, 10_000);
+            let rows = &random_world.query(&[&w_id]).unwrap();
+            let row = rows.get(0);
+            worlds.push(World {
+                id: row.get(0),
+                randomnumber: row.get(1),
+            });
+        }
+        Ok(worlds)
+    }
+}
+
+pub struct UpdateWorld(pub u16);
+
+impl Message for UpdateWorld {
+    type Result = io::Result<Vec<World>>;
+}
+
+impl Handler<UpdateWorld> for PgConnection {
+    type Result = io::Result<Vec<World>>;
+
+    fn handle(&mut self, msg: UpdateWorld, _: &mut Self::Context) -> Self::Result {
+        let get_world = self
+            .conn
+            .prepare_cached("SELECT id FROM world WHERE id=$1")
+            .unwrap();
+        let mut update = String::with_capacity(120 + 6 * msg.0 as usize);
+        update
+            .push_str("UPDATE world SET randomnumber = temp.randomnumber FROM (VALUES ");
+
+        let mut worlds = Vec::with_capacity(msg.0 as usize);
+        for _ in 0..msg.0 {
+            let random_id = self.rng.gen_range::<i32>(1, 10_000);
+            let rows = &get_world.query(&[&random_id]).unwrap();
+            let w = World {
+                id: rows.get(0).get(0),
+                randomnumber: self.rng.gen_range(1, 10_000),
+            };
+            update.push_str(&format!("({}, {}),", w.id, w.randomnumber));
+            worlds.push(w);
+        }
+        worlds.sort_by_key(|w| w.id);
+
+        update.pop();
+        update.push_str(") AS temp(id, randomnumber) WHERE temp.id = world.id");
+        self.conn.execute(&update, &[]).unwrap();
+
+        Ok(worlds)
+    }
+}
+
+pub struct TellFortune;
+
+impl Message for TellFortune {
+    type Result = io::Result<Vec<Fortune>>;
+}
+
+impl Handler<TellFortune> for PgConnection {
+    type Result = io::Result<Vec<Fortune>>;
+
+    fn handle(&mut self, _: TellFortune, _: &mut Self::Context) -> Self::Result {
+        let fortune = self
+            .conn
+            .prepare_cached("SELECT id, message FROM fortune")
+            .unwrap();
+
+        let mut items = Vec::with_capacity(16);
+        items.push(Fortune {
+            id: 0,
+            message: "Additional fortune added at request time.".to_string(),
+        });
+
+        for row in &fortune.query(&[])? {
+            items.push(Fortune {
+                id: row.get(0),
+                message: row.get(1),
+            });
+        }
+        items.sort_by(|it, next| it.message.cmp(&next.message));
+        Ok(items)
+    }
+}

+ 1 - 8
frameworks/Rust/actix/src/main.rs

@@ -12,14 +12,7 @@ use actix_web::{http, server, App, HttpRequest, HttpResponse};
 use bytes::BytesMut;
 
 mod utils;
-use utils::Writer;
-
-const SIZE: usize = 29;
-
-#[derive(Serialize, Deserialize)]
-pub struct Message {
-    pub message: &'static str,
-}
+use utils::{Message, Writer, SIZE};
 
 fn json(req: HttpRequest) -> HttpResponse {
     let message = Message {

+ 11 - 159
frameworks/Rust/actix/src/main_pg.rs

@@ -22,12 +22,12 @@ use askama::Template;
 use bytes::BytesMut;
 use futures::Future;
 use postgres::{Connection, TlsMode};
-use rand::{thread_rng, Rng, ThreadRng};
-use std::{cmp, io};
+use std::cmp;
 
+mod db_pg;
 mod models;
 mod utils;
-use models::{Fortune, World};
+use db_pg::{PgConnection, RandomWorld, RandomWorlds, TellFortune, UpdateWorld};
 use utils::Writer;
 
 struct State {
@@ -85,12 +85,11 @@ fn queries(req: HttpRequest<State>) -> FutureResponse<HttpResponse> {
 
 fn updates(req: HttpRequest<State>) -> FutureResponse<HttpResponse> {
     // get queries parameter
-    let q = if let Some(q) = req.query().get("q") {
-        q.parse::<u16>().ok().unwrap_or(1)
-    } else {
-        1
-    };
-    let q = cmp::min(500, cmp::max(1, q));
+    let q = req
+        .query()
+        .get("q")
+        .map(|q| cmp::min(500, cmp::max(1, q.parse::<u16>().ok().unwrap_or(1))))
+        .unwrap_or(1);
 
     // update db
     req.clone()
@@ -139,154 +138,6 @@ fn fortune(req: HttpRequest<State>) -> FutureResponse<HttpResponse> {
         .responder()
 }
 
-/// Postgres interface
-struct PgConnection {
-    conn: Connection,
-    rng: ThreadRng,
-}
-
-impl Actor for PgConnection {
-    type Context = SyncContext<Self>;
-}
-
-impl PgConnection {
-    pub fn new(db_url: &str) -> PgConnection {
-        let conn = Connection::connect(db_url, TlsMode::None)
-            .expect(&format!("Error connecting to {}", db_url));
-        PgConnection {
-            conn,
-            rng: thread_rng(),
-        }
-    }
-}
-
-unsafe impl Send for PgConnection {}
-
-pub struct RandomWorld;
-
-impl Message for RandomWorld {
-    type Result = io::Result<World>;
-}
-
-impl Handler<RandomWorld> for PgConnection {
-    type Result = io::Result<World>;
-
-    fn handle(&mut self, _: RandomWorld, _: &mut Self::Context) -> Self::Result {
-        let random_world = self
-            .conn
-            .prepare_cached("SELECT id, randomnumber FROM world WHERE id=$1")
-            .unwrap();
-
-        let random_id = self.rng.gen_range::<i32>(1, 10_000);
-        let rows = &random_world.query(&[&random_id]).unwrap();
-        let row = rows.get(0);
-        Ok(World {
-            id: row.get(0),
-            randomnumber: row.get(1),
-        })
-    }
-}
-
-pub struct RandomWorlds(pub u16);
-
-impl Message for RandomWorlds {
-    type Result = io::Result<Vec<World>>;
-}
-
-impl Handler<RandomWorlds> for PgConnection {
-    type Result = io::Result<Vec<World>>;
-
-    fn handle(&mut self, msg: RandomWorlds, _: &mut Self::Context) -> Self::Result {
-        let random_world = self
-            .conn
-            .prepare_cached("SELECT id, randomnumber FROM world WHERE id=$1")
-            .unwrap();
-
-        let mut worlds = Vec::with_capacity(msg.0 as usize);
-        for _ in 0..msg.0 {
-            let w_id: i32 = self.rng.gen_range(1, 10_000);
-            let rows = &random_world.query(&[&w_id]).unwrap();
-            let row = rows.get(0);
-            worlds.push(World {
-                id: row.get(0),
-                randomnumber: row.get(1),
-            });
-        }
-        Ok(worlds)
-    }
-}
-
-pub struct UpdateWorld(pub u16);
-
-impl Message for UpdateWorld {
-    type Result = io::Result<Vec<World>>;
-}
-
-impl Handler<UpdateWorld> for PgConnection {
-    type Result = io::Result<Vec<World>>;
-
-    fn handle(&mut self, msg: UpdateWorld, _: &mut Self::Context) -> Self::Result {
-        let get_world = self
-            .conn
-            .prepare_cached("SELECT id FROM world WHERE id=$1")
-            .unwrap();
-        let mut update = String::with_capacity(120 + 6 * msg.0 as usize);
-        update
-            .push_str("UPDATE world SET randomnumber = temp.randomnumber FROM (VALUES ");
-
-        let mut worlds = Vec::with_capacity(msg.0 as usize);
-        for _ in 0..msg.0 {
-            let random_id = self.rng.gen_range::<i32>(1, 10_000);
-            let rows = &get_world.query(&[&random_id]).unwrap();
-            let w = World {
-                id: rows.get(0).get(0),
-                randomnumber: self.rng.gen_range(1, 10_000),
-            };
-            update.push_str(&format!("({}, {}),", w.id, w.randomnumber));
-            worlds.push(w);
-        }
-        worlds.sort_by_key(|w| w.id);
-
-        update.pop();
-        update.push_str(") AS temp(id, randomnumber) WHERE temp.id = world.id");
-        self.conn.execute(&update, &[]).unwrap();
-
-        Ok(worlds)
-    }
-}
-
-pub struct TellFortune;
-
-impl Message for TellFortune {
-    type Result = io::Result<Vec<Fortune>>;
-}
-
-impl Handler<TellFortune> for PgConnection {
-    type Result = io::Result<Vec<Fortune>>;
-
-    fn handle(&mut self, _: TellFortune, _: &mut Self::Context) -> Self::Result {
-        let fortune = self
-            .conn
-            .prepare_cached("SELECT id, message FROM fortune")
-            .unwrap();
-
-        let mut items = Vec::with_capacity(16);
-        items.push(Fortune {
-            id: 0,
-            message: "Additional fortune added at request time.".to_string(),
-        });
-
-        for row in &fortune.query(&[])? {
-            items.push(Fortune {
-                id: row.get(0),
-                message: row.get(1),
-            });
-        }
-        items.sort_by(|it, next| it.message.cmp(&next.message));
-        Ok(items)
-    }
-}
-
 fn main() {
     let sys = System::new("techempower");
     let db_url = "postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world";
@@ -300,8 +151,9 @@ fn main() {
     }
 
     // Start db executor actors
-    let addr =
-        SyncArbiter::start(num_cpus::get() * 4, move || PgConnection::new(db_url));
+    let addr = SyncArbiter::start(num_cpus::get() * 4, move || {
+        db_pg::PgConnection::new(db_url)
+    });
 
     // start http server
     server::new(move || {

+ 159 - 0
frameworks/Rust/actix/src/main_raw.rs

@@ -0,0 +1,159 @@
+extern crate actix;
+extern crate actix_web;
+extern crate bytes;
+extern crate futures;
+extern crate serde;
+extern crate serde_json;
+#[macro_use]
+extern crate serde_derive;
+#[macro_use]
+extern crate askama;
+extern crate num_cpus;
+extern crate postgres;
+extern crate rand;
+#[macro_use]
+extern crate diesel;
+
+use std::io;
+
+use actix::prelude::*;
+use actix_web::server::{self, HttpHandler, HttpHandlerTask, HttpServer, Writer};
+use actix_web::{Error, HttpRequest};
+use askama::Template;
+use bytes::BytesMut;
+use futures::{Async, Future, Poll};
+use postgres::{Connection, TlsMode};
+
+mod db_pg;
+mod models;
+mod utils;
+
+use db_pg::{PgConnection, TellFortune};
+use utils::{Message, Writer as JsonWriter, SIZE};
+
+const HTTPOK: &[u8] = b"HTTP/1.1 200 OK\r\n";
+const HDR_SERVER: &[u8] = b"Server: Actix\r\n";
+const HDR_CTPLAIN: &[u8] = b"Content-Type: text/plain";
+const HDR_CTJSON: &[u8] = b"Content-Type: application/json";
+const HDR_CTHTML: &[u8] = b"Content-Type: text/html; charset=utf-8";
+const BODY: &[u8] = b"Hello, World!";
+
+struct App {
+    db: Addr<Syn, PgConnection>,
+}
+
+impl HttpHandler for App {
+    fn handle(&mut self, req: HttpRequest) -> Result<Box<HttpHandlerTask>, HttpRequest> {
+        match req.path() {
+            "/plaintext" => Ok(Box::new(Plaintext)),
+            "/json" => Ok(Box::new(Json)),
+            "/fortune" => {
+                let fut = Box::new(self.db.send(TellFortune));
+                Ok(Box::new(Fortune { fut }))
+            }
+            _ => Err(req),
+        }
+    }
+}
+
+struct Plaintext;
+
+impl HttpHandlerTask for Plaintext {
+    fn poll_io(&mut self, io: &mut Writer) -> Poll<bool, Error> {
+        let mut bytes = io.buffer();
+        bytes.reserve(196);
+        bytes.extend_from_slice(HTTPOK);
+        bytes.extend_from_slice(HDR_SERVER);
+        bytes.extend_from_slice(HDR_CTPLAIN);
+        server::write_content_length(BODY.len(), &mut bytes);
+        io.set_date(bytes);
+        bytes.extend_from_slice(BODY);
+        Ok(Async::Ready(true))
+    }
+}
+
+struct Json;
+
+impl HttpHandlerTask for Json {
+    fn poll_io(&mut self, io: &mut Writer) -> Poll<bool, Error> {
+        let message = Message {
+            message: "Hello, World!",
+        };
+        let mut body = BytesMut::with_capacity(SIZE);
+        serde_json::to_writer(JsonWriter(&mut body), &message).unwrap();
+
+        let mut bytes = io.buffer();
+        bytes.reserve(196);
+        bytes.extend_from_slice(HTTPOK);
+        bytes.extend_from_slice(HDR_SERVER);
+        bytes.extend_from_slice(HDR_CTJSON);
+        server::write_content_length(body.len(), &mut bytes);
+        io.set_date(bytes);
+        bytes.extend_from_slice(&body[..]);
+        Ok(Async::Ready(true))
+    }
+}
+
+struct Fortune {
+    fut: Box<
+        Future<Item = io::Result<Vec<models::Fortune>>, Error = actix::MailboxError>,
+    >,
+}
+
+#[derive(Template)]
+#[template(path = "fortune.html")]
+struct FortuneTemplate<'a> {
+    items: &'a Vec<models::Fortune>,
+}
+
+impl HttpHandlerTask for Fortune {
+    fn poll_io(&mut self, io: &mut Writer) -> Poll<bool, Error> {
+        match self.fut.poll() {
+            Ok(Async::Ready(Ok(rows))) => {
+                let tmpl = FortuneTemplate { items: &rows };
+                let body = tmpl.render().unwrap();
+
+                let mut bytes = io.buffer();
+                bytes.reserve(196 + body.len());
+                bytes.extend_from_slice(HTTPOK);
+                bytes.extend_from_slice(HDR_SERVER);
+                bytes.extend_from_slice(HDR_CTHTML);
+                server::write_content_length(body.len(), &mut bytes);
+                io.set_date(bytes);
+                bytes.extend_from_slice(body.as_ref());
+                Ok(Async::Ready(true))
+            }
+            Ok(Async::NotReady) => Ok(Async::NotReady),
+            Ok(Async::Ready(Err(e))) => Err(e.into()),
+            Err(e) => Err(e.into()),
+        }
+    }
+}
+
+fn main() {
+    let sys = System::new("techempower");
+    let db_url = "postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world";
+
+    // Avoid triggering "FATAL: the database system is starting up" error from
+    // postgres.
+    {
+        if Connection::connect(db_url, TlsMode::None).is_err() {
+            std::thread::sleep(std::time::Duration::from_secs(5));
+        }
+    }
+
+    // Start db executor actors
+    let addr = SyncArbiter::start(num_cpus::get() * 4, move || {
+        db_pg::PgConnection::new(db_url)
+    });
+
+    // start http server
+    HttpServer::new(move || vec![App { db: addr.clone() }])
+        .backlog(8192)
+        .bind("0.0.0.0:8080")
+        .unwrap()
+        .start();
+
+    println!("Started http server: 127.0.0.1:8080");
+    let _ = sys.run();
+}

+ 184 - 0
frameworks/Rust/actix/src/main_raw_db.rs

@@ -0,0 +1,184 @@
+extern crate actix;
+extern crate actix_web;
+extern crate bytes;
+extern crate futures;
+extern crate serde;
+extern crate serde_json;
+#[macro_use]
+extern crate serde_derive;
+extern crate num_cpus;
+extern crate postgres;
+extern crate rand;
+#[macro_use]
+extern crate diesel;
+
+use std::{cmp, io};
+
+use actix::prelude::*;
+use actix_web::server::{self, HttpHandler, HttpHandlerTask, HttpServer, Writer};
+use actix_web::{Error, HttpRequest};
+use bytes::BytesMut;
+use futures::{Async, Future, Poll};
+use postgres::{Connection, TlsMode};
+
+mod db_pg;
+mod models;
+mod utils;
+
+use db_pg::{PgConnection, RandomWorld, RandomWorlds, UpdateWorld};
+use utils::Writer as JsonWriter;
+
+const HTTPOK: &[u8] = b"HTTP/1.1 200 OK\r\n";
+const HDR_SERVER: &[u8] = b"Server: Actix\r\n";
+const HDR_JSON: &[u8] = b"Content-Type: application/json";
+
+struct App {
+    db: Addr<Syn, PgConnection>,
+}
+
+impl HttpHandler for App {
+    fn handle(&mut self, req: HttpRequest) -> Result<Box<HttpHandlerTask>, HttpRequest> {
+        match req.path() {
+            "/db" => Ok(Box::new(World {
+                fut: Box::new(self.db.send(RandomWorld)),
+            })),
+            "/queries" => {
+                let q = req
+                    .query()
+                    .get("q")
+                    .map(|q| {
+                        cmp::min(500, cmp::max(1, q.parse::<u16>().ok().unwrap_or(1)))
+                    })
+                    .unwrap_or(1);
+                Ok(Box::new(Queries {
+                    fut: Box::new(self.db.send(RandomWorlds(q))),
+                }))
+            }
+            "/updates" => {
+                let q = req
+                    .query()
+                    .get("q")
+                    .map(|q| {
+                        cmp::min(500, cmp::max(1, q.parse::<u16>().ok().unwrap_or(1)))
+                    })
+                    .unwrap_or(1);
+                Ok(Box::new(Updates {
+                    fut: Box::new(self.db.send(UpdateWorld(q))),
+                }))
+            }
+            _ => Err(req),
+        }
+    }
+}
+
+struct World {
+    fut: Box<Future<Item = io::Result<models::World>, Error = actix::MailboxError>>,
+}
+
+impl HttpHandlerTask for World {
+    fn poll_io(&mut self, io: &mut Writer) -> Poll<bool, Error> {
+        match self.fut.poll() {
+            Ok(Async::Ready(Ok(row))) => {
+                let mut body = BytesMut::with_capacity(31);
+                serde_json::to_writer(JsonWriter(&mut body), &row).unwrap();
+
+                let mut bytes = io.buffer();
+                bytes.reserve(196);
+                bytes.extend_from_slice(HTTPOK);
+                bytes.extend_from_slice(HDR_SERVER);
+                bytes.extend_from_slice(HDR_JSON);
+                server::write_content_length(body.len(), &mut bytes);
+                io.set_date(bytes);
+                bytes.extend_from_slice(body.as_ref());
+                Ok(Async::Ready(true))
+            }
+            Ok(Async::NotReady) => Ok(Async::NotReady),
+            Ok(Async::Ready(Err(e))) => Err(e.into()),
+            Err(e) => Err(e.into()),
+        }
+    }
+}
+
+struct Queries {
+    fut: Box<Future<Item = io::Result<Vec<models::World>>, Error = actix::MailboxError>>,
+}
+
+impl HttpHandlerTask for Queries {
+    fn poll_io(&mut self, io: &mut Writer) -> Poll<bool, Error> {
+        match self.fut.poll() {
+            Ok(Async::Ready(Ok(worlds))) => {
+                let mut body = BytesMut::with_capacity(35 * worlds.len());
+                serde_json::to_writer(JsonWriter(&mut body), &worlds).unwrap();
+
+                let mut bytes = io.buffer();
+                bytes.reserve(196);
+                bytes.extend_from_slice(HTTPOK);
+                bytes.extend_from_slice(HDR_SERVER);
+                bytes.extend_from_slice(HDR_JSON);
+                server::write_content_length(body.len(), &mut bytes);
+                io.set_date(bytes);
+                bytes.extend_from_slice(body.as_ref());
+                Ok(Async::Ready(true))
+            }
+            Ok(Async::NotReady) => Ok(Async::NotReady),
+            Ok(Async::Ready(Err(e))) => Err(e.into()),
+            Err(e) => Err(e.into()),
+        }
+    }
+}
+
+struct Updates {
+    fut: Box<Future<Item = io::Result<Vec<models::World>>, Error = actix::MailboxError>>,
+}
+
+impl HttpHandlerTask for Updates {
+    fn poll_io(&mut self, io: &mut Writer) -> Poll<bool, Error> {
+        match self.fut.poll() {
+            Ok(Async::Ready(Ok(worlds))) => {
+                let mut body = BytesMut::with_capacity(35 * worlds.len());
+                serde_json::to_writer(JsonWriter(&mut body), &worlds).unwrap();
+
+                let mut bytes = io.buffer();
+                bytes.reserve(196 + body.len());
+                bytes.extend_from_slice(HTTPOK);
+                bytes.extend_from_slice(HDR_SERVER);
+                bytes.extend_from_slice(HDR_JSON);
+                server::write_content_length(body.len(), &mut bytes);
+                io.set_date(bytes);
+                bytes.extend_from_slice(body.as_ref());
+                Ok(Async::Ready(true))
+            }
+            Ok(Async::NotReady) => Ok(Async::NotReady),
+            Ok(Async::Ready(Err(e))) => Err(e.into()),
+            Err(e) => Err(e.into()),
+        }
+    }
+}
+
+fn main() {
+    let sys = System::new("techempower");
+    let db_url = "postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world";
+
+    // Avoid triggering "FATAL: the database system is starting up" error from
+    // postgres.
+    {
+        if Connection::connect(db_url, TlsMode::None).is_err() {
+            std::thread::sleep(std::time::Duration::from_secs(5));
+        }
+    }
+
+    // Start db executor actors
+    let addr = SyncArbiter::start(num_cpus::get() * 3, move || {
+        db_pg::PgConnection::new(db_url)
+    });
+
+    // start http server
+    HttpServer::new(move || vec![App { db: addr.clone() }])
+        .backlog(8192)
+        .bind("0.0.0.0:8080")
+        .unwrap()
+        .start();
+
+    println!("Started http server: 127.0.0.1:8080");
+    let _ = sys.run();
+}

+ 8 - 0
frameworks/Rust/actix/src/utils.rs

@@ -1,6 +1,14 @@
+#![allow(dead_code)]
 use bytes::BytesMut;
 use std::io;
 
+pub const SIZE: usize = 29;
+
+#[derive(Serialize, Deserialize)]
+pub struct Message {
+    pub message: &'static str,
+}
+
 pub struct Writer<'a>(pub &'a mut BytesMut);
 
 impl<'a> io::Write for Writer<'a> {