diff --git a/frameworks/typev/Dockerfile b/frameworks/typev/Dockerfile index 1fd66d1c..fb3d4e8a 100644 --- a/frameworks/typev/Dockerfile +++ b/frameworks/typev/Dockerfile @@ -12,7 +12,7 @@ WORKDIR /app # typev VM — binary + FFI plugins (json, stdcore, stdsocket, ...). Pre-built # (-O3 -march=x86-64-v3, static liburing) and fetched from object storage RUN wget -q -O /tmp/typev.zip \ - https://typev.s3.fr-par.scw.cloud/typev-21-05-2026.zip && \ + https://typev.s3.fr-par.scw.cloud/typev-23-05-2026-v2.zip && \ unzip -q /tmp/typev.zip -d /app && \ rm /tmp/typev.zip diff --git a/frameworks/typev/bundle/benchmark-code/src/main.tc b/frameworks/typev/bundle/benchmark-code/src/main.tc index 3be5cc06..5f702c19 100644 --- a/frameworks/typev/bundle/benchmark-code/src/main.tc +++ b/frameworks/typev/bundle/benchmark-code/src/main.tc @@ -99,12 +99,14 @@ fn drainUpload(fd: int, buf: byte[], bufcap: uint, bodyStart: uint, cl: uint, cu // Serve one connection. fn handle_client(fd: int) -> void { + // resizeRaw: these buffers are write-before-read (tcp_read fills, parser + // reads only up to the filled length), so skip the per-connection zero-fill. let buf: byte[] = [] - buf.resize(BUFCAP) + buf.resizeRaw(BUFCAP) let tmp: byte[] = [] - tmp.resize(BUFCAP) + tmp.resizeRaw(BUFCAP) let obuf: byte[] = [] - obuf.resize(OBUFCAP) + obuf.resizeRaw(OBUFCAP) // Parse scratch — created once, reused for every request. let req = newReq() let chunk = newChunk() @@ -277,22 +279,11 @@ fn accept_loop() -> void { fn main() -> uint { println("typev HttpArena server listening on :8080") - foreach i in 0, 3, 1 { + let keepalive = spawn accept_loop() + foreach i in 0, 2, 1 { spawn accept_loop() } - - let server = tcp_listen(PORT, 4096) - if server < 0 { - println("Failed to start server") - return 1u - } - - while true { - let client = tcp_accept(server) - if client >= 0 { - spawn handle_client(client) - } - } + let (_r, _s) = keepalive.await() return 0u } diff --git a/frameworks/typev/bundle/output.tvbc b/frameworks/typev/bundle/output.tvbc index d715baf8..bf63e6ad 100644 Binary files a/frameworks/typev/bundle/output.tvbc and b/frameworks/typev/bundle/output.tvbc differ diff --git a/site/data/baseline-4096.json b/site/data/baseline-4096.json index f146e515..92980ce7 100644 --- a/site/data/baseline-4096.json +++ b/site/data/baseline-4096.json @@ -1308,19 +1308,19 @@ { "framework": "typev", "language": "Type-C", - "rps": 2238245, - "avg_latency": "160us", - "p99_latency": "681us", - "cpu": "6230.3%", - "memory": "448MiB", + "rps": 2159262, + "avg_latency": "150us", + "p99_latency": "729us", + "cpu": "6556.8%", + "memory": "396MiB", "connections": 4096, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "192.04MB/s", - "input_bw": "172.90MB/s", + "bandwidth": "185.27MB/s", + "input_bw": "166.80MB/s", "reconnects": 0, - "status_2xx": 11191228, + "status_2xx": 10796310, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 diff --git a/site/data/baseline-512.json b/site/data/baseline-512.json index 2e4e9899..69c638a1 100644 --- a/site/data/baseline-512.json +++ b/site/data/baseline-512.json @@ -1308,19 +1308,19 @@ { "framework": "typev", "language": "Type-C", - "rps": 2230325, - "avg_latency": "125us", - "p99_latency": "665us", - "cpu": "6378.6%", - "memory": "211MiB", + "rps": 2232140, + "avg_latency": "107us", + "p99_latency": "636us", + "cpu": "6380.0%", + "memory": "156MiB", "connections": 512, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "191.36MB/s", - "input_bw": "172.29MB/s", + "bandwidth": "191.53MB/s", + "input_bw": "172.43MB/s", "reconnects": 0, - "status_2xx": 11151628, + "status_2xx": 11160704, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 diff --git a/site/data/current.json b/site/data/current.json index f8d0404a..f8816ee0 100644 --- a/site/data/current.json +++ b/site/data/current.json @@ -5,7 +5,7 @@ "threads_per_core": "2", "ram": "251Gi", "os": "Ubuntu 24.04.4 LTS", - "kernel": "6.17.0-22-generic", + "kernel": "6.17.0-29-generic", "docker": "29.3.0", "docker_runtime": "runc", "governor": "performance", diff --git a/site/data/echo-ws-16384.json b/site/data/echo-ws-16384.json index 0e2205ae..5e0740ad 100644 --- a/site/data/echo-ws-16384.json +++ b/site/data/echo-ws-16384.json @@ -369,18 +369,18 @@ { "framework": "typev", "language": "Type-C", - "rps": 3048278, - "avg_latency": "170us", - "p99_latency": "1.53ms", - "cpu": "6266.4%", - "memory": "751MiB", + "rps": 2681888, + "avg_latency": "160us", + "p99_latency": "1.02ms", + "cpu": "6185.7%", + "memory": "818MiB", "connections": 16384, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "20.37MB/s", + "bandwidth": "18.01MB/s", "reconnects": 0, - "status_2xx": 15241392, + "status_2xx": 13409442, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 diff --git a/site/data/echo-ws-4096.json b/site/data/echo-ws-4096.json index 3c856a36..257b35e0 100644 --- a/site/data/echo-ws-4096.json +++ b/site/data/echo-ws-4096.json @@ -369,18 +369,18 @@ { "framework": "typev", "language": "Type-C", - "rps": 2981735, - "avg_latency": "145us", - "p99_latency": "548us", - "cpu": "6441.7%", - "memory": "450MiB", + "rps": 2738284, + "avg_latency": "140us", + "p99_latency": "639us", + "cpu": "6294.2%", + "memory": "464MiB", "connections": 4096, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "19.90MB/s", + "bandwidth": "18.28MB/s", "reconnects": 0, - "status_2xx": 14908675, + "status_2xx": 13691422, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 diff --git a/site/data/echo-ws-512.json b/site/data/echo-ws-512.json index 8551d41b..afceea16 100644 --- a/site/data/echo-ws-512.json +++ b/site/data/echo-ws-512.json @@ -369,18 +369,18 @@ { "framework": "typev", "language": "Type-C", - "rps": 3017632, - "avg_latency": "105us", - "p99_latency": "480us", - "cpu": "6739.4%", - "memory": "269MiB", + "rps": 2839865, + "avg_latency": "93us", + "p99_latency": "474us", + "cpu": "6717.4%", + "memory": "177MiB", "connections": 512, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "20.14MB/s", + "bandwidth": "18.95MB/s", "reconnects": 0, - "status_2xx": 15088164, + "status_2xx": 14199326, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 diff --git a/site/data/echo-ws-pipeline-16384.json b/site/data/echo-ws-pipeline-16384.json index 98010ccf..308ad403 100644 --- a/site/data/echo-ws-pipeline-16384.json +++ b/site/data/echo-ws-pipeline-16384.json @@ -230,18 +230,18 @@ { "framework": "typev", "language": "Type-C", - "rps": 19139286, - "avg_latency": "308us", - "p99_latency": "1.04ms", - "cpu": "6358.2%", - "memory": "458MiB", + "rps": 18274678, + "avg_latency": "386us", + "p99_latency": "2.74ms", + "cpu": "6083.0%", + "memory": "362MiB", "connections": 16384, "threads": 64, "duration": "5s", "pipeline": 16, - "bandwidth": "127.73MB/s", + "bandwidth": "121.96MB/s", "reconnects": 0, - "status_2xx": 95696432, + "status_2xx": 91373392, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 diff --git a/site/data/echo-ws-pipeline-4096.json b/site/data/echo-ws-pipeline-4096.json index 43cae863..8ec70085 100644 --- a/site/data/echo-ws-pipeline-4096.json +++ b/site/data/echo-ws-pipeline-4096.json @@ -230,18 +230,18 @@ { "framework": "typev", "language": "Type-C", - "rps": 19362240, - "avg_latency": "184us", - "p99_latency": "846us", - "cpu": "6677.0%", - "memory": "422MiB", + "rps": 18343548, + "avg_latency": "219us", + "p99_latency": "458us", + "cpu": "6309.3%", + "memory": "458MiB", "connections": 4096, "threads": 64, "duration": "5s", "pipeline": 16, - "bandwidth": "129.22MB/s", + "bandwidth": "122.41MB/s", "reconnects": 0, - "status_2xx": 96811200, + "status_2xx": 91717744, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 diff --git a/site/data/echo-ws-pipeline-512.json b/site/data/echo-ws-pipeline-512.json index f026551e..759f3426 100644 --- a/site/data/echo-ws-pipeline-512.json +++ b/site/data/echo-ws-pipeline-512.json @@ -230,18 +230,18 @@ { "framework": "typev", "language": "Type-C", - "rps": 18460480, - "avg_latency": "166us", - "p99_latency": "140us", - "cpu": "6464.7%", - "memory": "273MiB", + "rps": 18372604, + "avg_latency": "146us", + "p99_latency": "135us", + "cpu": "6378.4%", + "memory": "182MiB", "connections": 512, "threads": 64, "duration": "5s", "pipeline": 16, - "bandwidth": "123.20MB/s", + "bandwidth": "122.61MB/s", "reconnects": 0, - "status_2xx": 92302400, + "status_2xx": 91863023, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 diff --git a/site/data/json-4096.json b/site/data/json-4096.json index 8b25083f..64bc6da6 100644 --- a/site/data/json-4096.json +++ b/site/data/json-4096.json @@ -1036,19 +1036,19 @@ { "framework": "typev", "language": "Type-C", - "rps": 1194865, - "avg_latency": "3.00ms", - "p99_latency": "2.70ms", - "cpu": "6751.2%", - "memory": "673MiB", + "rps": 1227325, + "avg_latency": "2.96ms", + "p99_latency": "82.00ms", + "cpu": "6396.4%", + "memory": "720MiB", "connections": 4096, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "4.02GB/s", - "input_bw": "56.98MB/s", - "reconnects": 238578, - "status_2xx": 5974326, + "bandwidth": "4.13GB/s", + "input_bw": "58.52MB/s", + "reconnects": 244966, + "status_2xx": 6136626, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 diff --git a/site/data/limited-conn-4096.json b/site/data/limited-conn-4096.json index b2e9e95d..7fcabf92 100644 --- a/site/data/limited-conn-4096.json +++ b/site/data/limited-conn-4096.json @@ -1308,19 +1308,19 @@ { "framework": "typev", "language": "Type-C", - "rps": 1544570, - "avg_latency": "2.61ms", - "p99_latency": "155.40ms", - "cpu": "6625.4%", - "memory": "379MiB", + "rps": 1674965, + "avg_latency": "2.43ms", + "p99_latency": "34.40ms", + "cpu": "6595.2%", + "memory": "472MiB", "connections": 4096, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "132.55MB/s", - "input_bw": "119.31MB/s", - "reconnects": 772280, - "status_2xx": 7722850, + "bandwidth": "143.72MB/s", + "input_bw": "129.39MB/s", + "reconnects": 837480, + "status_2xx": 8374829, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 diff --git a/site/data/limited-conn-512.json b/site/data/limited-conn-512.json index 3c81a934..a0411e93 100644 --- a/site/data/limited-conn-512.json +++ b/site/data/limited-conn-512.json @@ -1308,19 +1308,19 @@ { "framework": "typev", "language": "Type-C", - "rps": 1496006, - "avg_latency": "331us", - "p99_latency": "8.95ms", - "cpu": "6641.2%", - "memory": "257MiB", + "rps": 1708478, + "avg_latency": "289us", + "p99_latency": "4.52ms", + "cpu": "6541.8%", + "memory": "314MiB", "connections": 512, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "128.39MB/s", - "input_bw": "115.56MB/s", - "reconnects": 747995, - "status_2xx": 7480034, + "bandwidth": "146.60MB/s", + "input_bw": "131.98MB/s", + "reconnects": 854230, + "status_2xx": 8542394, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 diff --git a/site/data/pipelined-4096.json b/site/data/pipelined-4096.json index f4f64a9b..6825ca16 100644 --- a/site/data/pipelined-4096.json +++ b/site/data/pipelined-4096.json @@ -1239,18 +1239,18 @@ { "framework": "typev", "language": "Type-C", - "rps": 46959193, - "avg_latency": "262us", - "p99_latency": "1.20ms", - "cpu": "6257.5%", - "memory": "380MiB", + "rps": 46159084, + "avg_latency": "189us", + "p99_latency": "731us", + "cpu": "6258.8%", + "memory": "451MiB", "connections": 4096, "threads": 64, "duration": "5s", "pipeline": 16, - "bandwidth": "3.93GB/s", + "bandwidth": "3.87GB/s", "reconnects": 0, - "status_2xx": 234795968, + "status_2xx": 230795424, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 diff --git a/site/data/pipelined-512.json b/site/data/pipelined-512.json index ea48cd39..f455025d 100644 --- a/site/data/pipelined-512.json +++ b/site/data/pipelined-512.json @@ -1239,18 +1239,18 @@ { "framework": "typev", "language": "Type-C", - "rps": 48455952, - "avg_latency": "167us", - "p99_latency": "917us", - "cpu": "6464.7%", - "memory": "289MiB", + "rps": 44170000, + "avg_latency": "153us", + "p99_latency": "608us", + "cpu": "6624.6%", + "memory": "181MiB", "connections": 512, "threads": 64, "duration": "5s", "pipeline": 16, - "bandwidth": "4.06GB/s", + "bandwidth": "3.70GB/s", "reconnects": 0, - "status_2xx": 242279760, + "status_2xx": 220850000, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 diff --git a/site/data/static-1024.json b/site/data/static-1024.json index 148cc892..90a57c1b 100644 --- a/site/data/static-1024.json +++ b/site/data/static-1024.json @@ -1062,18 +1062,18 @@ { "framework": "typev", "language": "Type-C", - "rps": 1135054, - "avg_latency": "19.41ms", - "p99_latency": "19.41ms", - "cpu": "6372.0%", - "memory": "295MiB", + "rps": 1123368, + "avg_latency": "25.78ms", + "p99_latency": "25.78ms", + "cpu": "6447.9%", + "memory": "221MiB", "connections": 1024, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "17.32GB", + "bandwidth": "17.14GB", "reconnects": 0, - "status_2xx": 5788327, + "status_2xx": 5728879, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 diff --git a/site/data/static-4096.json b/site/data/static-4096.json index 4f3e1202..26bcfc87 100644 --- a/site/data/static-4096.json +++ b/site/data/static-4096.json @@ -1062,18 +1062,18 @@ { "framework": "typev", "language": "Type-C", - "rps": 1166570, - "avg_latency": "62.92ms", - "p99_latency": "62.92ms", - "cpu": "6157.0%", - "memory": "670MiB", + "rps": 1130947, + "avg_latency": "68.91ms", + "p99_latency": "68.91ms", + "cpu": "6226.6%", + "memory": "335MiB", "connections": 4096, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "17.80GB", + "bandwidth": "17.25GB", "reconnects": 0, - "status_2xx": 5949621, + "status_2xx": 5767207, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 diff --git a/site/data/static-6800.json b/site/data/static-6800.json index 0d5c28fa..bb9f9f31 100644 --- a/site/data/static-6800.json +++ b/site/data/static-6800.json @@ -1062,18 +1062,18 @@ { "framework": "typev", "language": "Type-C", - "rps": 1146000, - "avg_latency": "32.67ms", - "p99_latency": "32.67ms", - "cpu": "6427.0%", - "memory": "1.4GiB", + "rps": 1123290, + "avg_latency": "31.44ms", + "p99_latency": "31.44ms", + "cpu": "6319.4%", + "memory": "647MiB", "connections": 6800, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "17.48GB", + "bandwidth": "17.14GB", "reconnects": 0, - "status_2xx": 5844717, + "status_2xx": 5728593, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 diff --git a/site/data/upload-256.json b/site/data/upload-256.json index 190b6402..3e7ccbf0 100644 --- a/site/data/upload-256.json +++ b/site/data/upload-256.json @@ -981,19 +981,19 @@ { "framework": "typev", "language": "Type-C", - "rps": 3009, - "avg_latency": "77.92ms", - "p99_latency": "226.90ms", - "cpu": "3569.8%", - "memory": "297MiB", + "rps": 3053, + "avg_latency": "77.28ms", + "p99_latency": "251.20ms", + "cpu": "3797.3%", + "memory": "279MiB", "connections": 256, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "280.12KB/s", - "input_bw": "23.87GB/s", - "reconnects": 2995, - "status_2xx": 15138, + "bandwidth": "283.98KB/s", + "input_bw": "24.22GB/s", + "reconnects": 3030, + "status_2xx": 15331, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 diff --git a/site/data/upload-32.json b/site/data/upload-32.json index 33aec010..cefd8649 100644 --- a/site/data/upload-32.json +++ b/site/data/upload-32.json @@ -981,19 +981,19 @@ { "framework": "typev", "language": "Type-C", - "rps": 3056, - "avg_latency": "10.45ms", - "p99_latency": "31.20ms", - "cpu": "1979.2%", - "memory": "201MiB", + "rps": 3152, + "avg_latency": "10.10ms", + "p99_latency": "27.70ms", + "cpu": "1662.5%", + "memory": "187MiB", "connections": 32, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "284.18KB/s", - "input_bw": "24.24GB/s", - "reconnects": 3055, - "status_2xx": 15284, + "bandwidth": "293.41KB/s", + "input_bw": "25.00GB/s", + "reconnects": 3153, + "status_2xx": 15796, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0