├── README.md ├── go ├── .gitignore ├── build.sh ├── go.mod ├── go.sum ├── htlatencies-go ├── main.go └── run.sh ├── haskell ├── .gitignore ├── LICENSE ├── Setup.hs ├── app │ └── Main.hs ├── build.sh ├── htlatencies.cabal ├── run.sh ├── stack.yaml └── stack.yaml.lock ├── node ├── build.sh ├── main.js └── run.sh ├── ocaml-reason ├── .gitignore ├── .merlin ├── Main.ml ├── Main.re ├── build.sh └── run.sh ├── programs.txt ├── python-uwsgi ├── build.sh ├── main.py └── run.sh ├── reports ├── go ├── haskell ├── histogram.png ├── node ├── ocaml-reason ├── python-uwsgi ├── rust-actix └── swift-zewo ├── rust-actix ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── build.sh ├── run.sh └── src │ └── main.rs ├── swift-zewo ├── .gitignore ├── CMakeLists.txt ├── Package.swift ├── Sources │ └── main.swift ├── build.sh └── run.sh └── test.sh /README.md: -------------------------------------------------------------------------------- 1 | # Hashtable latencies 2 | 3 | This benchmark measures the latency of a web service that stores a large 4 | (250K item) hashtable, in multiple languages. 5 | 6 | Garbage collected languages are of greater interest, and the Swift version 7 | is mostly used as a reference of what would be ideal. 8 | 9 | # Rules for implementations. 10 | 11 | * Each HTTP request will add one new item (and remove one if count > 250K) 12 | * Each item will be a new 1KB buffer with every byte initialized to a value. 13 | * Programs will listen on port 8080 and respond with status 200, body "OK" 14 | 15 | # Structure 16 | 17 | * All program directories are listed in programs.txt 18 | * Every directory should contain `build.sh` and `run.sh` 19 | * [wrk2](https://github.com/giltene/wrk2) must be installed and linked in $PATH as `wrk2` 20 | 21 | # Tests 22 | 23 | * Warmup: 9K req/s are sent for 60s (initial hash table content) 24 | * Test : 9K req/s are sent by 99 clients concurrently for 180s 25 | 26 | # Output: 27 | 28 | * All reports are in `reports` directory. 29 | * Charts from both tests can be generated by using [hdrhistogram](http://hdrhistogram.github.io/HdrHistogram/plotFiles.html) 30 | 31 | # Current results 32 | 33 | ![chart](https://github.com/spion/hashtable-latencies/blob/ed3ac5c72f47950ac7ee936365035e6095b32e31/reports/histogram.png) 34 | 35 | # Program notes 36 | 37 | * go - Go version is go1.6.2 darwin/amd64; uses fasthttp. Using the built-in http library results 38 | with a lot more work for the GC, and a chart similar to the one seen for Haskell. 39 | * ocaml-reason - This is built with OCaml 4.03+flambda (ReasonML is currently not compatible 40 | with OCaml 4.03 so the ML version was generated from it using `refmt` first). Follow the 41 | instructions here: https://ocaml.org/docs/install.html 42 | * node - Requires node 6.x (`Buffer.alloc` API) 43 | * haskell - Should build easily if you have [stack][his] 44 | * swift-zewo - You should setup [swiftenv to the right snapshot][swiftenv] 45 | 46 | # Conclusions 47 | 48 | Want to build low-latency, memory-intensive services in a GCed language? Use 49 | OCaml (or Reason if you prefer the syntax). 50 | 51 | # OCaml GC notes 52 | 53 | Other things that were attempted to make the latency worse for OCaml: 54 | 55 | * random buffer sizes 56 | * longer running time 57 | 58 | # TODO: 59 | 60 | * simulate extra GC work on a percentage of requests (i.e. creating T temporary objects of size S) 61 | 62 | 63 | 64 | [rii]: https://github.com/facebook/reason/blob/master/README.md#install-stable 65 | [his]: http://docs.haskellstack.org/en/stable/README/#how-to-install 66 | [swiftenv]: https://github.com/Zewo/Zewo#swiftenv 67 | -------------------------------------------------------------------------------- /go/.gitignore: -------------------------------------------------------------------------------- 1 | go 2 | -------------------------------------------------------------------------------- /go/build.sh: -------------------------------------------------------------------------------- 1 | go get -u github.com/valyala/fasthttp 2 | go build 3 | mv ./go ./htlatencies-go -------------------------------------------------------------------------------- /go/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/spion/hashtable-latencies/go 2 | 3 | go 1.20 4 | 5 | require ( 6 | github.com/andybalholm/brotli v1.0.5 // indirect 7 | github.com/klauspost/compress v1.16.5 // indirect 8 | github.com/valyala/bytebufferpool v1.0.0 // indirect 9 | github.com/valyala/fasthttp v1.46.0 // indirect 10 | ) 11 | -------------------------------------------------------------------------------- /go/go.sum: -------------------------------------------------------------------------------- 1 | github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= 2 | github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= 3 | github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= 4 | github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= 5 | github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= 6 | github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= 7 | github.com/valyala/fasthttp v1.46.0 h1:6ZRhrFg8zBXTRYY6vdzbFhqsBd7FVv123pV2m9V87U4= 8 | github.com/valyala/fasthttp v1.46.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= 9 | -------------------------------------------------------------------------------- /go/htlatencies-go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spion/hashtable-latencies/ba43887ed91ef07416247e0d936bd159a8fee180/go/htlatencies-go -------------------------------------------------------------------------------- /go/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "io" 5 | "net/http" 6 | "sync" 7 | ) 8 | 9 | func main() { 10 | mutex := &sync.Mutex{} 11 | m := make(map[int][]byte) 12 | cnt := 0 13 | max := 250000 14 | 15 | handler := func(w http.ResponseWriter, r *http.Request) { 16 | newBuffer := make([]byte, 1024) 17 | mutex.Lock() 18 | m[cnt] = newBuffer 19 | if cnt >= max { 20 | delete(m, cnt-max) 21 | } 22 | cnt = cnt + 1 23 | mutex.Unlock() 24 | io.WriteString(w, "OK") 25 | } 26 | http.HandleFunc("/", handler) 27 | http.ListenAndServe(":8080", nil) 28 | } 29 | -------------------------------------------------------------------------------- /go/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec ./htlatencies-go 4 | -------------------------------------------------------------------------------- /haskell/.gitignore: -------------------------------------------------------------------------------- 1 | .stack-work 2 | -------------------------------------------------------------------------------- /haskell/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright Author name here (c) 2016 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above 12 | copyright notice, this list of conditions and the following 13 | disclaimer in the documentation and/or other materials provided 14 | with the distribution. 15 | 16 | * Neither the name of Author name here nor the names of other 17 | contributors may be used to endorse or promote products derived 18 | from this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /haskell/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /haskell/app/Main.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE OverloadedStrings #-} 2 | 3 | import Network.Wai 4 | import Network.HTTP.Types 5 | import Network.Wai.Handler.Warp (run) 6 | import Data.HashTable.IO as HIO 7 | import qualified Data.ByteString as BS 8 | import Control.Concurrent.MVar 9 | import Control.Monad (when) 10 | 11 | data Msg = Msg !BS.ByteString 12 | 13 | data Service = Service (MVar Int) (HIO.BasicHashTable Int Msg) 14 | 15 | maxItems = 250000 16 | 17 | message :: Int -> Msg 18 | message n = Msg $ BS.replicate 1024 (fromIntegral n) 19 | 20 | main :: IO () 21 | main = do 22 | svc <- Service <$> newMVar 0 <*> HIO.newSized maxItems; 23 | run 8080 (app svc) 24 | 25 | app :: Service -> Application 26 | app svc request respond = 27 | case rawPathInfo request of 28 | "/" -> handle svc request respond 29 | _ -> handle404 request respond 30 | 31 | handle (Service counter hash) _ respond = do 32 | cnt <- takeMVar counter 33 | let msg = message cnt 34 | HIO.insert hash cnt msg 35 | when (cnt >= maxItems) $ HIO.delete hash (cnt - maxItems) 36 | putMVar counter (cnt + 1) 37 | respond $ responseLBS status200 [] "OK" 38 | 39 | handle404 :: Application 40 | handle404 _ respond = 41 | respond $ responseLBS status404 [] "Not Found" 42 | -------------------------------------------------------------------------------- /haskell/build.sh: -------------------------------------------------------------------------------- 1 | stack build 2 | -------------------------------------------------------------------------------- /haskell/htlatencies.cabal: -------------------------------------------------------------------------------- 1 | name: htlatencies 2 | version: 0.1.0.0 3 | synopsis: Initial project template from stack 4 | description: Please see README.md 5 | homepage: https://github.com/githubuser/htlatencies#readme 6 | license: BSD3 7 | license-file: LICENSE 8 | author: Author name here 9 | maintainer: example@example.com 10 | copyright: 2016 Author name here 11 | category: Web 12 | build-type: Simple 13 | -- extra-source-files: 14 | cabal-version: >=1.10 15 | 16 | executable htlatencies-exe 17 | hs-source-dirs: app 18 | main-is: Main.hs 19 | ghc-options: -threaded -rtsopts -with-rtsopts=-N 20 | build-depends: base 21 | , wai 22 | , warp 23 | , http-types 24 | , hashtables 25 | , bytestring 26 | 27 | default-language: Haskell2010 28 | 29 | 30 | source-repository head 31 | type: git 32 | location: https://github.com/githubuser/htlatencies 33 | -------------------------------------------------------------------------------- /haskell/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec .stack-work/install/*/*/*/bin/htlatencies-exe +RTS -N4 4 | -------------------------------------------------------------------------------- /haskell/stack.yaml: -------------------------------------------------------------------------------- 1 | # This file was automatically generated by stack init 2 | # For more information, see: http://docs.haskellstack.org/en/stable/yaml_configuration/ 3 | 4 | # Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2) 5 | resolver: lts-20.18 6 | 7 | # Local packages, usually specified by relative directory name 8 | packages: 9 | - '.' 10 | # Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3) 11 | extra-deps: [] 12 | 13 | # Override default flag values for local packages and extra-deps 14 | flags: {} 15 | 16 | # Extra package databases containing global packages 17 | extra-package-dbs: [] 18 | 19 | # Control whether we use the GHC we find on the path 20 | # system-ghc: true 21 | 22 | # Require a specific version of stack, using version ranges 23 | # require-stack-version: -any # Default 24 | # require-stack-version: >= 1.0.0 25 | 26 | # Override the architecture used by stack, especially useful on Windows 27 | # arch: i386 28 | # arch: x86_64 29 | 30 | # Extra directories used by stack for building 31 | # extra-include-dirs: [/path/to/dir] 32 | # extra-lib-dirs: [/path/to/dir] 33 | 34 | # Allow a newer minor version of GHC than the snapshot specifies 35 | # compiler-check: newer-minor 36 | -------------------------------------------------------------------------------- /haskell/stack.yaml.lock: -------------------------------------------------------------------------------- 1 | # This file was autogenerated by Stack. 2 | # You should not edit this file by hand. 3 | # For more information, please see the documentation at: 4 | # https://docs.haskellstack.org/en/stable/lock_files 5 | 6 | packages: [] 7 | snapshots: 8 | - completed: 9 | size: 649606 10 | url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/18.yaml 11 | sha256: 9fa4bece7acfac1fc7930c5d6e24606004b09e80aa0e52e9f68b148201008db9 12 | original: lts-20.18 13 | -------------------------------------------------------------------------------- /node/build.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spion/hashtable-latencies/ba43887ed91ef07416247e0d936bd159a8fee180/node/build.sh -------------------------------------------------------------------------------- /node/main.js: -------------------------------------------------------------------------------- 1 | function handler() { 2 | var d = new Map() 3 | var reqNo = 0; 4 | var TOTAL = 250000 5 | 6 | return function(req, res) { 7 | reqNo = reqNo + 1 8 | d.set(reqNo, Buffer.alloc(1024)) 9 | if (reqNo >= TOTAL) { 10 | d.delete(reqNo - TOTAL) 11 | } 12 | res.end("OK"); 13 | } 14 | } 15 | 16 | require('http').createServer(handler()).listen(8080) 17 | -------------------------------------------------------------------------------- /node/run.sh: -------------------------------------------------------------------------------- 1 | exec node main.js 2 | -------------------------------------------------------------------------------- /ocaml-reason/.gitignore: -------------------------------------------------------------------------------- 1 | _build 2 | Main.native 3 | -------------------------------------------------------------------------------- /ocaml-reason/.merlin: -------------------------------------------------------------------------------- 1 | PKG cohttp lwt async 2 | -------------------------------------------------------------------------------- /ocaml-reason/Main.ml: -------------------------------------------------------------------------------- 1 | open Lwt 2 | open Cohttp 3 | open Cohttp_lwt_unix 4 | open Hashtbl 5 | open Buffer 6 | 7 | let limit = 250000 8 | let tbl: (int,Buffer.t) Hashtbl.t = Hashtbl.create limit 9 | type counter = { 10 | mutable c: int;} 11 | let server = 12 | let cnt: counter = { c = 0 } in 13 | let callback _conn req body = 14 | let k = cnt.c in 15 | Hashtbl.add tbl k (Buffer.create 1024); 16 | if k >= limit then Hashtbl.remove tbl (k - limit); 17 | cnt.c <- cnt.c + 1; 18 | Server.respond_string ~status:`OK ~body:"OK" () in 19 | let s = Server.make ~callback () in Server.create s 20 | let () = ignore (Lwt_main.run server) 21 | -------------------------------------------------------------------------------- /ocaml-reason/Main.re: -------------------------------------------------------------------------------- 1 | open Lwt; 2 | open Cohttp; 3 | open Cohttp_lwt_unix; 4 | open Hashtbl; 5 | open Buffer; 6 | 7 | let limit = 250000; 8 | 9 | let tbl : Hashtbl.t int Buffer.t = Hashtbl.create limit; 10 | 11 | type counter = {mutable c: int}; 12 | 13 | let server = { 14 | let cnt:counter = {c: 0}; 15 | 16 | let callback _conn req body => { 17 | let k = cnt.c; 18 | Hashtbl.add tbl k (Buffer.create 1024); 19 | if (k >= limit) { 20 | Hashtbl.remove tbl (k - limit); 21 | }; 22 | cnt.c = cnt.c + 1; 23 | Server.respond_string status::`OK body::"OK" () 24 | }; 25 | let s = Server.make callback::callback (); 26 | Server.create s 27 | }; 28 | 29 | let () = ignore (Lwt_main.run server); 30 | -------------------------------------------------------------------------------- /ocaml-reason/build.sh: -------------------------------------------------------------------------------- 1 | ocamlbuild -pkgs cohttp,lwt,cohttp.lwt Main.native 2 | -------------------------------------------------------------------------------- /ocaml-reason/run.sh: -------------------------------------------------------------------------------- 1 | exec ./Main.native 2 | -------------------------------------------------------------------------------- /programs.txt: -------------------------------------------------------------------------------- 1 | ocaml-reason 2 | swift-zewo 3 | python-uwsgi 4 | haskell 5 | node 6 | go 7 | rust-actix 8 | -------------------------------------------------------------------------------- /python-uwsgi/build.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | export PYTHONUSERBASE=$PWD/pyenv 3 | python3 -m pip install --quiet --user uwsgi 4 | -------------------------------------------------------------------------------- /python-uwsgi/main.py: -------------------------------------------------------------------------------- 1 | 2 | storage = {} 3 | request_no = 0 4 | total_requests = 250000 5 | 6 | headers = [] 7 | headers.append(('Connection', 'close')) 8 | headers.append(('Content-Type', 'text/plain')) 9 | # headers.append(('Content-Length', '2')) - borks wrk2 10 | 11 | def application(env, start_response): 12 | global request_no 13 | request_no += 1 14 | storage[request_no] = bytearray(1024) 15 | if request_no > total_requests: 16 | del storage[request_no - total_requests] 17 | 18 | start_response('200 OK', headers) 19 | return [b"ok"] 20 | -------------------------------------------------------------------------------- /python-uwsgi/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | export PYTHONUSERBASE=$PWD/pyenv 3 | exec $PYTHONUSERBASE/bin/uwsgi --master --die-on-term --disable-logging \ 4 | --wsgi-file main.py \ 5 | --http-socket :8080 6 | # --plugin gevent --gevent 1000 7 | # --workers 4 8 | # --plugin python 9 | -------------------------------------------------------------------------------- /reports/go: -------------------------------------------------------------------------------- 1 | Running 10m test @ http://localhost:8080 2 | 3 threads and 99 connections 3 | Thread calibration: mean lat.: 0.998ms, rate sampling interval: 10ms 4 | Thread calibration: mean lat.: 1.008ms, rate sampling interval: 10ms 5 | Thread calibration: mean lat.: 1.000ms, rate sampling interval: 10ms 6 | Thread Stats Avg Stdev Max +/- Stdev 7 | Latency 0.99ms 484.92us 7.97ms 65.89% 8 | Req/Sec 3.50k 296.26 5.55k 82.25% 9 | Latency Distribution (HdrHistogram - Recorded Latency) 10 | 50.000% 0.94ms 11 | 75.000% 1.30ms 12 | 90.000% 1.68ms 13 | 99.000% 2.16ms 14 | 99.900% 2.43ms 15 | 99.990% 2.86ms 16 | 99.999% 5.66ms 17 | 100.000% 7.97ms 18 | 19 | Detailed Percentile spectrum: 20 | Value Percentile TotalCount 1/(1-Percentile) 21 | 22 | 0.029 0.000000 1 1.00 23 | 0.375 0.100000 590656 1.11 24 | 0.541 0.200000 1182392 1.25 25 | 0.682 0.300000 1772965 1.43 26 | 0.814 0.400000 2361453 1.67 27 | 0.945 0.500000 2952117 2.00 28 | 1.011 0.550000 3247386 2.22 29 | 1.078 0.600000 3542337 2.50 30 | 1.146 0.650000 3835196 2.86 31 | 1.217 0.700000 4129345 3.33 32 | 1.296 0.750000 4424977 4.00 33 | 1.341 0.775000 4571721 4.44 34 | 1.393 0.800000 4719317 5.00 35 | 1.454 0.825000 4868075 5.71 36 | 1.522 0.850000 5014426 6.67 37 | 1.597 0.875000 5161746 8.00 38 | 1.636 0.887500 5234767 8.89 39 | 1.678 0.900000 5309311 10.00 40 | 1.721 0.912500 5382880 11.43 41 | 1.767 0.925000 5456171 13.33 42 | 1.816 0.937500 5529694 16.00 43 | 1.843 0.943750 5567013 17.78 44 | 1.871 0.950000 5603707 20.00 45 | 1.902 0.956250 5641195 22.86 46 | 1.935 0.962500 5678129 26.67 47 | 1.972 0.968750 5714897 32.00 48 | 1.992 0.971875 5732920 35.56 49 | 2.014 0.975000 5751499 40.00 50 | 2.038 0.978125 5769844 45.71 51 | 2.065 0.981250 5788502 53.33 52 | 2.095 0.984375 5806606 64.00 53 | 2.111 0.985938 5815422 71.11 54 | 2.131 0.987500 5825564 80.00 55 | 2.149 0.989062 5833844 91.43 56 | 2.173 0.990625 5843752 106.67 57 | 2.197 0.992188 5852576 128.00 58 | 2.211 0.992969 5857061 142.22 59 | 2.227 0.993750 5861821 160.00 60 | 2.243 0.994531 5866143 182.86 61 | 2.263 0.995313 5871056 213.33 62 | 2.283 0.996094 5875285 256.00 63 | 2.297 0.996484 5877930 284.44 64 | 2.309 0.996875 5879998 320.00 65 | 2.323 0.997266 5882265 365.71 66 | 2.341 0.997656 5884721 426.67 67 | 2.359 0.998047 5886830 512.00 68 | 2.371 0.998242 5888117 568.89 69 | 2.383 0.998437 5889269 640.00 70 | 2.397 0.998633 5890405 731.43 71 | 2.411 0.998828 5891438 853.33 72 | 2.429 0.999023 5892616 1024.00 73 | 2.439 0.999121 5893169 1137.78 74 | 2.451 0.999219 5893777 1280.00 75 | 2.465 0.999316 5894373 1462.86 76 | 2.479 0.999414 5894915 1706.67 77 | 2.499 0.999512 5895506 2048.00 78 | 2.509 0.999561 5895779 2275.56 79 | 2.523 0.999609 5896062 2560.00 80 | 2.537 0.999658 5896333 2925.71 81 | 2.555 0.999707 5896631 3413.33 82 | 2.577 0.999756 5896895 4096.00 83 | 2.593 0.999780 5897042 4551.11 84 | 2.615 0.999805 5897182 5120.00 85 | 2.639 0.999829 5897317 5851.43 86 | 2.677 0.999854 5897463 6826.67 87 | 2.739 0.999878 5897605 8192.00 88 | 2.803 0.999890 5897680 9102.22 89 | 2.877 0.999902 5897749 10240.00 90 | 2.997 0.999915 5897821 11702.86 91 | 3.143 0.999927 5897893 13653.33 92 | 3.393 0.999939 5897965 16384.00 93 | 3.535 0.999945 5898001 18204.44 94 | 3.739 0.999951 5898037 20480.00 95 | 3.919 0.999957 5898073 23405.71 96 | 4.131 0.999963 5898109 27306.67 97 | 4.379 0.999969 5898145 32768.00 98 | 4.583 0.999973 5898163 36408.89 99 | 4.755 0.999976 5898183 40960.00 100 | 4.895 0.999979 5898199 46811.43 101 | 5.087 0.999982 5898217 54613.33 102 | 5.271 0.999985 5898236 65536.00 103 | 5.371 0.999986 5898244 72817.78 104 | 5.475 0.999988 5898253 81920.00 105 | 5.587 0.999989 5898263 93622.86 106 | 5.751 0.999991 5898271 109226.67 107 | 5.915 0.999992 5898280 131072.00 108 | 6.091 0.999993 5898286 145635.56 109 | 6.171 0.999994 5898289 163840.00 110 | 6.423 0.999995 5898294 187245.71 111 | 6.455 0.999995 5898298 218453.33 112 | 6.655 0.999996 5898303 262144.00 113 | 6.823 0.999997 5898305 291271.11 114 | 6.931 0.999997 5898307 327680.00 115 | 7.135 0.999997 5898310 374491.43 116 | 7.155 0.999998 5898312 436906.67 117 | 7.211 0.999998 5898314 524288.00 118 | 7.247 0.999998 5898315 582542.22 119 | 7.255 0.999998 5898316 655360.00 120 | 7.439 0.999999 5898318 748982.86 121 | 7.479 0.999999 5898319 873813.33 122 | 7.535 0.999999 5898320 1048576.00 123 | 7.535 0.999999 5898320 1165084.44 124 | 7.559 0.999999 5898321 1310720.00 125 | 7.671 0.999999 5898322 1497965.71 126 | 7.671 0.999999 5898322 1747626.67 127 | 7.863 1.000000 5898323 2097152.00 128 | 7.863 1.000000 5898323 2330168.89 129 | 7.863 1.000000 5898323 2621440.00 130 | 7.963 1.000000 5898324 2995931.43 131 | 7.963 1.000000 5898324 3495253.33 132 | 7.963 1.000000 5898324 4194304.00 133 | 7.963 1.000000 5898324 4660337.78 134 | 7.963 1.000000 5898324 5242880.00 135 | 7.971 1.000000 5898325 5991862.86 136 | 7.971 1.000000 5898325 inf 137 | #[Mean = 0.985, StdDeviation = 0.485] 138 | #[Max = 7.968, Total count = 5898325] 139 | #[Buckets = 27, SubBuckets = 2048] 140 | ---------------------------------------------------------- 141 | 5999233 requests in 10.00m, 675.12MB read 142 | Requests/sec: 9998.71 143 | Transfer/sec: 1.13MB 144 | -------------------------------------------------------------------------------- /reports/haskell: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spion/hashtable-latencies/ba43887ed91ef07416247e0d936bd159a8fee180/reports/haskell -------------------------------------------------------------------------------- /reports/histogram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spion/hashtable-latencies/ba43887ed91ef07416247e0d936bd159a8fee180/reports/histogram.png -------------------------------------------------------------------------------- /reports/node: -------------------------------------------------------------------------------- 1 | Running 10m test @ http://localhost:8080 2 | 3 threads and 99 connections 3 | Thread calibration: mean lat.: 1.888ms, rate sampling interval: 10ms 4 | Thread calibration: mean lat.: 1.893ms, rate sampling interval: 10ms 5 | Thread calibration: mean lat.: 1.898ms, rate sampling interval: 10ms 6 | Thread Stats Avg Stdev Max +/- Stdev 7 | Latency 1.96ms 4.58ms 44.74ms 95.65% 8 | Req/Sec 3.52k 1.00k 12.56k 93.78% 9 | Latency Distribution (HdrHistogram - Recorded Latency) 10 | 50.000% 1.07ms 11 | 75.000% 1.47ms 12 | 90.000% 1.85ms 13 | 99.000% 29.23ms 14 | 99.900% 37.98ms 15 | 99.990% 42.59ms 16 | 99.999% 43.87ms 17 | 100.000% 44.77ms 18 | 19 | Detailed Percentile spectrum: 20 | Value Percentile TotalCount 1/(1-Percentile) 21 | 22 | 0.025 0.000000 1 1.00 23 | 0.422 0.100000 591657 1.11 24 | 0.608 0.200000 1182672 1.25 25 | 0.769 0.300000 1772531 1.43 26 | 0.922 0.400000 2360690 1.67 27 | 1.073 0.500000 2950560 2.00 28 | 1.149 0.550000 3245273 2.22 29 | 1.226 0.600000 3539483 2.50 30 | 1.305 0.650000 3835011 2.86 31 | 1.386 0.700000 4130205 3.33 32 | 1.471 0.750000 4426515 4.00 33 | 1.516 0.775000 4573468 4.44 34 | 1.564 0.800000 4720659 5.00 35 | 1.617 0.825000 4867762 5.71 36 | 1.677 0.850000 5013955 6.67 37 | 1.751 0.875000 5162331 8.00 38 | 1.795 0.887500 5235562 8.89 39 | 1.847 0.900000 5309425 10.00 40 | 1.909 0.912500 5382258 11.43 41 | 1.992 0.925000 5456029 13.33 42 | 2.127 0.937500 5530368 16.00 43 | 2.253 0.943750 5566818 17.78 44 | 2.689 0.950000 5603354 20.00 45 | 6.327 0.956250 5640215 22.86 46 | 10.495 0.962500 5677104 26.67 47 | 14.799 0.968750 5713991 32.00 48 | 16.943 0.971875 5732438 35.56 49 | 19.103 0.975000 5750929 40.00 50 | 21.279 0.978125 5769233 45.71 51 | 23.327 0.981250 5787676 53.33 52 | 25.407 0.984375 5806103 64.00 53 | 26.479 0.985938 5815304 71.11 54 | 27.695 0.987500 5824612 80.00 55 | 28.639 0.989062 5833764 91.43 56 | 29.647 0.990625 5842954 106.67 57 | 30.847 0.992188 5852258 128.00 58 | 31.359 0.992969 5856784 142.22 59 | 31.839 0.993750 5861522 160.00 60 | 32.335 0.994531 5866102 182.86 61 | 32.863 0.995313 5870598 213.33 62 | 33.535 0.996094 5875248 256.00 63 | 33.983 0.996484 5877632 284.44 64 | 34.463 0.996875 5879865 320.00 65 | 35.039 0.997266 5882228 365.71 66 | 35.743 0.997656 5884525 426.67 67 | 36.415 0.998047 5886777 512.00 68 | 36.767 0.998242 5887959 568.89 69 | 37.087 0.998437 5889069 640.00 70 | 37.407 0.998633 5890263 731.43 71 | 37.695 0.998828 5891383 853.33 72 | 38.015 0.999023 5892504 1024.00 73 | 38.207 0.999121 5893088 1137.78 74 | 38.431 0.999219 5893666 1280.00 75 | 38.687 0.999316 5894220 1462.86 76 | 39.007 0.999414 5894852 1706.67 77 | 39.295 0.999512 5895375 2048.00 78 | 39.487 0.999561 5895658 2275.56 79 | 39.743 0.999609 5895949 2560.00 80 | 40.063 0.999658 5896253 2925.71 81 | 40.415 0.999707 5896543 3413.33 82 | 40.799 0.999756 5896827 4096.00 83 | 41.023 0.999780 5896959 4551.11 84 | 41.311 0.999805 5897096 5120.00 85 | 41.663 0.999829 5897244 5851.43 86 | 42.015 0.999854 5897397 6826.67 87 | 42.303 0.999878 5897528 8192.00 88 | 42.463 0.999890 5897604 9102.22 89 | 42.623 0.999902 5897677 10240.00 90 | 42.783 0.999915 5897744 11702.86 91 | 42.943 0.999927 5897836 13653.33 92 | 43.039 0.999939 5897889 16384.00 93 | 43.135 0.999945 5897931 18204.44 94 | 43.199 0.999951 5897959 20480.00 95 | 43.263 0.999957 5897995 23405.71 96 | 43.359 0.999963 5898034 27306.67 97 | 43.487 0.999969 5898073 32768.00 98 | 43.519 0.999973 5898085 36408.89 99 | 43.583 0.999976 5898110 40960.00 100 | 43.615 0.999979 5898121 46811.43 101 | 43.679 0.999982 5898144 54613.33 102 | 43.711 0.999985 5898157 65536.00 103 | 43.743 0.999986 5898166 72817.78 104 | 43.775 0.999988 5898174 81920.00 105 | 43.871 0.999989 5898192 93622.86 106 | 43.871 0.999991 5898192 109226.67 107 | 43.935 0.999992 5898203 131072.00 108 | 43.967 0.999993 5898207 145635.56 109 | 43.999 0.999994 5898211 163840.00 110 | 44.063 0.999995 5898217 187245.71 111 | 44.095 0.999995 5898220 218453.33 112 | 44.127 0.999996 5898225 262144.00 113 | 44.159 0.999997 5898226 291271.11 114 | 44.191 0.999997 5898230 327680.00 115 | 44.223 0.999997 5898231 374491.43 116 | 44.255 0.999998 5898234 436906.67 117 | 44.287 0.999998 5898235 524288.00 118 | 44.319 0.999998 5898236 582542.22 119 | 44.351 0.999998 5898238 655360.00 120 | 44.383 0.999999 5898239 748982.86 121 | 44.415 0.999999 5898240 873813.33 122 | 44.479 0.999999 5898242 1048576.00 123 | 44.479 0.999999 5898242 1165084.44 124 | 44.479 0.999999 5898242 1310720.00 125 | 44.671 0.999999 5898244 1497965.71 126 | 44.671 0.999999 5898244 1747626.67 127 | 44.671 1.000000 5898244 2097152.00 128 | 44.671 1.000000 5898244 2330168.89 129 | 44.671 1.000000 5898244 2621440.00 130 | 44.703 1.000000 5898245 2995931.43 131 | 44.703 1.000000 5898245 3495253.33 132 | 44.703 1.000000 5898245 4194304.00 133 | 44.703 1.000000 5898245 4660337.78 134 | 44.703 1.000000 5898245 5242880.00 135 | 44.767 1.000000 5898246 5991862.86 136 | 44.767 1.000000 5898246 inf 137 | #[Mean = 1.959, StdDeviation = 4.582] 138 | #[Max = 44.736, Total count = 5898246] 139 | #[Buckets = 27, SubBuckets = 2048] 140 | ---------------------------------------------------------- 141 | 5999130 requests in 10.00m, 709.43MB read 142 | Requests/sec: 9998.07 143 | Transfer/sec: 1.18MB 144 | -------------------------------------------------------------------------------- /reports/ocaml-reason: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spion/hashtable-latencies/ba43887ed91ef07416247e0d936bd159a8fee180/reports/ocaml-reason -------------------------------------------------------------------------------- /reports/python-uwsgi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spion/hashtable-latencies/ba43887ed91ef07416247e0d936bd159a8fee180/reports/python-uwsgi -------------------------------------------------------------------------------- /reports/rust-actix: -------------------------------------------------------------------------------- 1 | Running 4m test @ http://localhost:8080 2 | 3 threads and 99 connections 3 | Thread calibration: mean lat.: 0.766ms, rate sampling interval: 10ms 4 | Thread calibration: mean lat.: 0.761ms, rate sampling interval: 10ms 5 | Thread calibration: mean lat.: 0.789ms, rate sampling interval: 10ms 6 | Thread Stats Avg Stdev Max +/- Stdev 7 | Latency 767.85us 386.73us 3.20ms 62.06% 8 | Req/Sec 3.44k 226.77 5.00k 71.04% 9 | Latency Distribution (HdrHistogram - Recorded Latency) 10 | 50.000% 769.00us 11 | 75.000% 1.07ms 12 | 90.000% 1.26ms 13 | 99.000% 1.70ms 14 | 99.900% 2.07ms 15 | 99.990% 2.35ms 16 | 99.999% 2.75ms 17 | 100.000% 3.20ms 18 | 19 | Detailed Percentile spectrum: 20 | Value Percentile TotalCount 1/(1-Percentile) 21 | 22 | 0.026 0.000000 2 1.00 23 | 0.244 0.100000 201049 1.11 24 | 0.380 0.200000 400872 1.25 25 | 0.513 0.300000 601026 1.43 26 | 0.641 0.400000 800715 1.67 27 | 0.769 0.500000 1000587 2.00 28 | 0.831 0.550000 1100007 2.22 29 | 0.892 0.600000 1200491 2.50 30 | 0.951 0.650000 1300405 2.86 31 | 1.009 0.700000 1399142 3.33 32 | 1.068 0.750000 1499123 4.00 33 | 1.098 0.775000 1549206 4.44 34 | 1.129 0.800000 1599841 5.00 35 | 1.160 0.825000 1648741 5.71 36 | 1.193 0.850000 1700011 6.67 37 | 1.226 0.875000 1749268 8.00 38 | 1.244 0.887500 1774873 8.89 39 | 1.262 0.900000 1799385 10.00 40 | 1.281 0.912500 1823745 11.43 41 | 1.302 0.925000 1848507 13.33 42 | 1.327 0.937500 1874418 16.00 43 | 1.340 0.943750 1886422 17.78 44 | 1.355 0.950000 1898676 20.00 45 | 1.372 0.956250 1910951 22.86 46 | 1.394 0.962500 1923737 26.67 47 | 1.422 0.968750 1935902 32.00 48 | 1.442 0.971875 1942155 35.56 49 | 1.468 0.975000 1948542 40.00 50 | 1.499 0.978125 1954634 45.71 51 | 1.539 0.981250 1960929 53.33 52 | 1.587 0.984375 1967168 64.00 53 | 1.615 0.985938 1970318 71.11 54 | 1.645 0.987500 1973375 80.00 55 | 1.677 0.989062 1976484 91.43 56 | 1.714 0.990625 1979630 106.67 57 | 1.754 0.992188 1982771 128.00 58 | 1.776 0.992969 1984319 142.22 59 | 1.800 0.993750 1985869 160.00 60 | 1.826 0.994531 1987412 182.86 61 | 1.856 0.995313 1988976 213.33 62 | 1.887 0.996094 1990531 256.00 63 | 1.906 0.996484 1991325 284.44 64 | 1.925 0.996875 1992118 320.00 65 | 1.945 0.997266 1992875 365.71 66 | 1.967 0.997656 1993654 426.67 67 | 1.992 0.998047 1994442 512.00 68 | 2.005 0.998242 1994820 568.89 69 | 2.021 0.998437 1995224 640.00 70 | 2.038 0.998633 1995605 731.43 71 | 2.055 0.998828 1996005 853.33 72 | 2.075 0.999023 1996419 1024.00 73 | 2.087 0.999121 1996590 1137.78 74 | 2.099 0.999219 1996788 1280.00 75 | 2.115 0.999316 1996974 1462.86 76 | 2.133 0.999414 1997172 1706.67 77 | 2.153 0.999512 1997367 2048.00 78 | 2.165 0.999561 1997473 2275.56 79 | 2.173 0.999609 1997556 2560.00 80 | 2.189 0.999658 1997655 2925.71 81 | 2.207 0.999707 1997750 3413.33 82 | 2.231 0.999756 1997848 4096.00 83 | 2.241 0.999780 1997893 4551.11 84 | 2.259 0.999805 1997946 5120.00 85 | 2.277 0.999829 1997992 5851.43 86 | 2.297 0.999854 1998040 6826.67 87 | 2.319 0.999878 1998090 8192.00 88 | 2.333 0.999890 1998113 9102.22 89 | 2.351 0.999902 1998142 10240.00 90 | 2.373 0.999915 1998164 11702.86 91 | 2.397 0.999927 1998186 13653.33 92 | 2.429 0.999939 1998211 16384.00 93 | 2.453 0.999945 1998223 18204.44 94 | 2.477 0.999951 1998237 20480.00 95 | 2.489 0.999957 1998247 23405.71 96 | 2.513 0.999963 1998259 27306.67 97 | 2.553 0.999969 1998274 32768.00 98 | 2.561 0.999973 1998278 36408.89 99 | 2.587 0.999976 1998284 40960.00 100 | 2.623 0.999979 1998290 46811.43 101 | 2.659 0.999982 1998296 54613.33 102 | 2.697 0.999985 1998302 65536.00 103 | 2.709 0.999986 1998305 72817.78 104 | 2.715 0.999988 1998308 81920.00 105 | 2.729 0.999989 1998311 93622.86 106 | 2.787 0.999991 1998314 109226.67 107 | 2.809 0.999992 1998317 131072.00 108 | 2.921 0.999993 1998319 145635.56 109 | 2.937 0.999994 1998320 163840.00 110 | 2.965 0.999995 1998322 187245.71 111 | 2.987 0.999995 1998323 218453.33 112 | 3.051 0.999996 1998325 262144.00 113 | 3.091 0.999997 1998326 291271.11 114 | 3.091 0.999997 1998326 327680.00 115 | 3.107 0.999997 1998327 374491.43 116 | 3.117 0.999998 1998328 436906.67 117 | 3.131 0.999998 1998329 524288.00 118 | 3.131 0.999998 1998329 582542.22 119 | 3.131 0.999998 1998329 655360.00 120 | 3.133 0.999999 1998330 748982.86 121 | 3.133 0.999999 1998330 873813.33 122 | 3.193 0.999999 1998331 1048576.00 123 | 3.193 0.999999 1998331 1165084.44 124 | 3.193 0.999999 1998331 1310720.00 125 | 3.193 0.999999 1998331 1497965.71 126 | 3.193 0.999999 1998331 1747626.67 127 | 3.199 1.000000 1998332 2097152.00 128 | 3.199 1.000000 1998332 inf 129 | #[Mean = 0.768, StdDeviation = 0.387] 130 | #[Max = 3.198, Total count = 1998332] 131 | #[Buckets = 27, SubBuckets = 2048] 132 | ---------------------------------------------------------- 133 | 2099232 requests in 3.50m, 154.15MB read 134 | Requests/sec: 9996.33 135 | Transfer/sec: 751.68KB 136 | -------------------------------------------------------------------------------- /reports/swift-zewo: -------------------------------------------------------------------------------- 1 | Running 3m test @ http://localhost:8080 2 | 3 threads and 99 connections 3 | Thread calibration: mean lat.: 1.670ms, rate sampling interval: 10ms 4 | Thread calibration: mean lat.: 1.641ms, rate sampling interval: 10ms 5 | Thread calibration: mean lat.: 2.768ms, rate sampling interval: 10ms 6 | Thread Stats Avg Stdev Max +/- Stdev 7 | Latency 1.98ms 1.15ms 13.49ms 69.30% 8 | Req/Sec 3.16k 324.46 5.80k 75.87% 9 | Latency Distribution (HdrHistogram - Recorded Latency) 10 | 50.000% 1.72ms 11 | 75.000% 2.63ms 12 | 90.000% 3.69ms 13 | 99.000% 5.19ms 14 | 99.900% 6.40ms 15 | 99.990% 8.27ms 16 | 99.999% 11.48ms 17 | 100.000% 13.49ms 18 | 19 | Detailed Percentile spectrum: 20 | Value Percentile TotalCount 1/(1-Percentile) 21 | 22 | 0.094 0.000000 2 1.00 23 | 0.708 0.100000 153048 1.11 24 | 0.991 0.200000 306008 1.25 25 | 1.228 0.300000 458859 1.43 26 | 1.468 0.400000 611724 1.67 27 | 1.720 0.500000 764449 2.00 28 | 1.860 0.550000 840694 2.22 29 | 2.017 0.600000 917182 2.50 30 | 2.197 0.650000 993573 2.86 31 | 2.401 0.700000 1070491 3.33 32 | 2.635 0.750000 1146438 4.00 33 | 2.771 0.775000 1184999 4.44 34 | 2.919 0.800000 1222945 5.00 35 | 3.085 0.825000 1261454 5.71 36 | 3.267 0.850000 1299416 6.67 37 | 3.469 0.875000 1337487 8.00 38 | 3.579 0.887500 1356765 8.89 39 | 3.693 0.900000 1375914 10.00 40 | 3.811 0.912500 1394963 11.43 41 | 3.941 0.925000 1414059 13.33 42 | 4.085 0.937500 1433249 16.00 43 | 4.163 0.943750 1442859 17.78 44 | 4.243 0.950000 1452133 20.00 45 | 4.335 0.956250 1461817 22.86 46 | 4.435 0.962500 1471390 26.67 47 | 4.547 0.968750 1480752 32.00 48 | 4.611 0.971875 1485621 35.56 49 | 4.679 0.975000 1490423 40.00 50 | 4.755 0.978125 1495134 45.71 51 | 4.839 0.981250 1499859 53.33 52 | 4.943 0.984375 1504722 64.00 53 | 5.003 0.985938 1507167 71.11 54 | 5.067 0.987500 1509506 80.00 55 | 5.139 0.989062 1511831 91.43 56 | 5.223 0.990625 1514218 106.67 57 | 5.319 0.992188 1516593 128.00 58 | 5.375 0.992969 1517805 142.22 59 | 5.435 0.993750 1518990 160.00 60 | 5.507 0.994531 1520211 182.86 61 | 5.587 0.995313 1521362 213.33 62 | 5.683 0.996094 1522546 256.00 63 | 5.739 0.996484 1523158 284.44 64 | 5.803 0.996875 1523770 320.00 65 | 5.871 0.997266 1524346 365.71 66 | 5.947 0.997656 1524936 426.67 67 | 6.039 0.998047 1525534 512.00 68 | 6.099 0.998242 1525836 568.89 69 | 6.163 0.998437 1526132 640.00 70 | 6.235 0.998633 1526435 731.43 71 | 6.311 0.998828 1526729 853.33 72 | 6.415 0.999023 1527035 1024.00 73 | 6.459 0.999121 1527173 1137.78 74 | 6.523 0.999219 1527329 1280.00 75 | 6.599 0.999316 1527470 1462.86 76 | 6.691 0.999414 1527621 1706.67 77 | 6.783 0.999512 1527772 2048.00 78 | 6.847 0.999561 1527846 2275.56 79 | 6.935 0.999609 1527917 2560.00 80 | 7.039 0.999658 1527996 2925.71 81 | 7.159 0.999707 1528067 3413.33 82 | 7.287 0.999756 1528141 4096.00 83 | 7.363 0.999780 1528180 4551.11 84 | 7.471 0.999805 1528216 5120.00 85 | 7.587 0.999829 1528254 5851.43 86 | 7.759 0.999854 1528291 6826.67 87 | 8.007 0.999878 1528329 8192.00 88 | 8.115 0.999890 1528347 9102.22 89 | 8.311 0.999902 1528365 10240.00 90 | 8.551 0.999915 1528384 11702.86 91 | 8.711 0.999927 1528403 13653.33 92 | 9.079 0.999939 1528421 16384.00 93 | 9.271 0.999945 1528431 18204.44 94 | 9.439 0.999951 1528440 20480.00 95 | 9.687 0.999957 1528449 23405.71 96 | 10.063 0.999963 1528459 27306.67 97 | 10.527 0.999969 1528468 32768.00 98 | 10.703 0.999973 1528473 36408.89 99 | 10.807 0.999976 1528477 40960.00 100 | 10.975 0.999979 1528482 46811.43 101 | 11.247 0.999982 1528487 54613.33 102 | 11.343 0.999985 1528491 65536.00 103 | 11.383 0.999986 1528494 72817.78 104 | 11.455 0.999988 1528496 81920.00 105 | 11.479 0.999989 1528499 93622.86 106 | 11.535 0.999991 1528503 109226.67 107 | 11.535 0.999992 1528503 131072.00 108 | 11.543 0.999993 1528504 145635.56 109 | 11.783 0.999994 1528505 163840.00 110 | 11.863 0.999995 1528506 187245.71 111 | 12.055 0.999995 1528508 218453.33 112 | 12.735 0.999996 1528509 262144.00 113 | 12.735 0.999997 1528509 291271.11 114 | 12.959 0.999997 1528510 327680.00 115 | 12.959 0.999997 1528510 374491.43 116 | 13.199 0.999998 1528511 436906.67 117 | 13.279 0.999998 1528512 524288.00 118 | 13.279 0.999998 1528512 582542.22 119 | 13.279 0.999998 1528512 655360.00 120 | 13.279 0.999999 1528512 748982.86 121 | 13.311 0.999999 1528513 873813.33 122 | 13.311 0.999999 1528513 1048576.00 123 | 13.311 0.999999 1528513 1165084.44 124 | 13.311 0.999999 1528513 1310720.00 125 | 13.311 0.999999 1528513 1497965.71 126 | 13.495 0.999999 1528514 1747626.67 127 | 13.495 1.000000 1528514 inf 128 | #[Mean = 1.979, StdDeviation = 1.152] 129 | #[Max = 13.488, Total count = 1528514] 130 | #[Buckets = 27, SubBuckets = 2048] 131 | ---------------------------------------------------------- 132 | 1616538 requests in 3.00m, 61.67MB read 133 | Requests/sec: 8980.74 134 | Transfer/sec: 350.81KB 135 | -------------------------------------------------------------------------------- /rust-actix/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /target -------------------------------------------------------------------------------- /rust-actix/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "actix-codec" 7 | version = "0.5.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "57a7559404a7f3573127aab53c08ce37a6c6a315c374a31070f3c91cd1b4a7fe" 10 | dependencies = [ 11 | "bitflags", 12 | "bytes", 13 | "futures-core", 14 | "futures-sink", 15 | "log", 16 | "memchr", 17 | "pin-project-lite", 18 | "tokio", 19 | "tokio-util", 20 | ] 21 | 22 | [[package]] 23 | name = "actix-http" 24 | version = "3.3.1" 25 | source = "registry+https://github.com/rust-lang/crates.io-index" 26 | checksum = "c2079246596c18b4a33e274ae10c0e50613f4d32a4198e09c7b93771013fed74" 27 | dependencies = [ 28 | "actix-codec", 29 | "actix-rt", 30 | "actix-service", 31 | "actix-utils", 32 | "ahash 0.8.3", 33 | "base64", 34 | "bitflags", 35 | "brotli", 36 | "bytes", 37 | "bytestring", 38 | "derive_more", 39 | "encoding_rs", 40 | "flate2", 41 | "futures-core", 42 | "h2", 43 | "http", 44 | "httparse", 45 | "httpdate", 46 | "itoa", 47 | "language-tags", 48 | "local-channel", 49 | "mime", 50 | "percent-encoding", 51 | "pin-project-lite", 52 | "rand", 53 | "sha1", 54 | "smallvec", 55 | "tokio", 56 | "tokio-util", 57 | "tracing", 58 | "zstd", 59 | ] 60 | 61 | [[package]] 62 | name = "actix-macros" 63 | version = "0.2.3" 64 | source = "registry+https://github.com/rust-lang/crates.io-index" 65 | checksum = "465a6172cf69b960917811022d8f29bc0b7fa1398bc4f78b3c466673db1213b6" 66 | dependencies = [ 67 | "quote", 68 | "syn", 69 | ] 70 | 71 | [[package]] 72 | name = "actix-router" 73 | version = "0.5.1" 74 | source = "registry+https://github.com/rust-lang/crates.io-index" 75 | checksum = "d66ff4d247d2b160861fa2866457e85706833527840e4133f8f49aa423a38799" 76 | dependencies = [ 77 | "bytestring", 78 | "http", 79 | "regex", 80 | "serde", 81 | "tracing", 82 | ] 83 | 84 | [[package]] 85 | name = "actix-rt" 86 | version = "2.8.0" 87 | source = "registry+https://github.com/rust-lang/crates.io-index" 88 | checksum = "15265b6b8e2347670eb363c47fc8c75208b4a4994b27192f345fcbe707804f3e" 89 | dependencies = [ 90 | "futures-core", 91 | "tokio", 92 | ] 93 | 94 | [[package]] 95 | name = "actix-server" 96 | version = "2.2.0" 97 | source = "registry+https://github.com/rust-lang/crates.io-index" 98 | checksum = "3e8613a75dd50cc45f473cee3c34d59ed677c0f7b44480ce3b8247d7dc519327" 99 | dependencies = [ 100 | "actix-rt", 101 | "actix-service", 102 | "actix-utils", 103 | "futures-core", 104 | "futures-util", 105 | "mio", 106 | "num_cpus", 107 | "socket2", 108 | "tokio", 109 | "tracing", 110 | ] 111 | 112 | [[package]] 113 | name = "actix-service" 114 | version = "2.0.2" 115 | source = "registry+https://github.com/rust-lang/crates.io-index" 116 | checksum = "3b894941f818cfdc7ccc4b9e60fa7e53b5042a2e8567270f9147d5591893373a" 117 | dependencies = [ 118 | "futures-core", 119 | "paste", 120 | "pin-project-lite", 121 | ] 122 | 123 | [[package]] 124 | name = "actix-utils" 125 | version = "3.0.1" 126 | source = "registry+https://github.com/rust-lang/crates.io-index" 127 | checksum = "88a1dcdff1466e3c2488e1cb5c36a71822750ad43839937f85d2f4d9f8b705d8" 128 | dependencies = [ 129 | "local-waker", 130 | "pin-project-lite", 131 | ] 132 | 133 | [[package]] 134 | name = "actix-web" 135 | version = "4.3.1" 136 | source = "registry+https://github.com/rust-lang/crates.io-index" 137 | checksum = "cd3cb42f9566ab176e1ef0b8b3a896529062b4efc6be0123046095914c4c1c96" 138 | dependencies = [ 139 | "actix-codec", 140 | "actix-http", 141 | "actix-macros", 142 | "actix-router", 143 | "actix-rt", 144 | "actix-server", 145 | "actix-service", 146 | "actix-utils", 147 | "actix-web-codegen", 148 | "ahash 0.7.6", 149 | "bytes", 150 | "bytestring", 151 | "cfg-if", 152 | "cookie", 153 | "derive_more", 154 | "encoding_rs", 155 | "futures-core", 156 | "futures-util", 157 | "http", 158 | "itoa", 159 | "language-tags", 160 | "log", 161 | "mime", 162 | "once_cell", 163 | "pin-project-lite", 164 | "regex", 165 | "serde", 166 | "serde_json", 167 | "serde_urlencoded", 168 | "smallvec", 169 | "socket2", 170 | "time", 171 | "url", 172 | ] 173 | 174 | [[package]] 175 | name = "actix-web-codegen" 176 | version = "4.2.0" 177 | source = "registry+https://github.com/rust-lang/crates.io-index" 178 | checksum = "2262160a7ae29e3415554a3f1fc04c764b1540c116aa524683208078b7a75bc9" 179 | dependencies = [ 180 | "actix-router", 181 | "proc-macro2", 182 | "quote", 183 | "syn", 184 | ] 185 | 186 | [[package]] 187 | name = "adler" 188 | version = "1.0.2" 189 | source = "registry+https://github.com/rust-lang/crates.io-index" 190 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 191 | 192 | [[package]] 193 | name = "ahash" 194 | version = "0.7.6" 195 | source = "registry+https://github.com/rust-lang/crates.io-index" 196 | checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" 197 | dependencies = [ 198 | "getrandom", 199 | "once_cell", 200 | "version_check", 201 | ] 202 | 203 | [[package]] 204 | name = "ahash" 205 | version = "0.8.3" 206 | source = "registry+https://github.com/rust-lang/crates.io-index" 207 | checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" 208 | dependencies = [ 209 | "cfg-if", 210 | "getrandom", 211 | "once_cell", 212 | "version_check", 213 | ] 214 | 215 | [[package]] 216 | name = "aho-corasick" 217 | version = "1.0.1" 218 | source = "registry+https://github.com/rust-lang/crates.io-index" 219 | checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" 220 | dependencies = [ 221 | "memchr", 222 | ] 223 | 224 | [[package]] 225 | name = "alloc-no-stdlib" 226 | version = "2.0.4" 227 | source = "registry+https://github.com/rust-lang/crates.io-index" 228 | checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" 229 | 230 | [[package]] 231 | name = "alloc-stdlib" 232 | version = "0.2.2" 233 | source = "registry+https://github.com/rust-lang/crates.io-index" 234 | checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" 235 | dependencies = [ 236 | "alloc-no-stdlib", 237 | ] 238 | 239 | [[package]] 240 | name = "autocfg" 241 | version = "1.1.0" 242 | source = "registry+https://github.com/rust-lang/crates.io-index" 243 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 244 | 245 | [[package]] 246 | name = "base64" 247 | version = "0.21.0" 248 | source = "registry+https://github.com/rust-lang/crates.io-index" 249 | checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" 250 | 251 | [[package]] 252 | name = "bitflags" 253 | version = "1.3.2" 254 | source = "registry+https://github.com/rust-lang/crates.io-index" 255 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 256 | 257 | [[package]] 258 | name = "block-buffer" 259 | version = "0.10.4" 260 | source = "registry+https://github.com/rust-lang/crates.io-index" 261 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 262 | dependencies = [ 263 | "generic-array", 264 | ] 265 | 266 | [[package]] 267 | name = "brotli" 268 | version = "3.3.4" 269 | source = "registry+https://github.com/rust-lang/crates.io-index" 270 | checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" 271 | dependencies = [ 272 | "alloc-no-stdlib", 273 | "alloc-stdlib", 274 | "brotli-decompressor", 275 | ] 276 | 277 | [[package]] 278 | name = "brotli-decompressor" 279 | version = "2.3.4" 280 | source = "registry+https://github.com/rust-lang/crates.io-index" 281 | checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" 282 | dependencies = [ 283 | "alloc-no-stdlib", 284 | "alloc-stdlib", 285 | ] 286 | 287 | [[package]] 288 | name = "bytes" 289 | version = "1.4.0" 290 | source = "registry+https://github.com/rust-lang/crates.io-index" 291 | checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" 292 | 293 | [[package]] 294 | name = "bytestring" 295 | version = "1.3.0" 296 | source = "registry+https://github.com/rust-lang/crates.io-index" 297 | checksum = "238e4886760d98c4f899360c834fa93e62cf7f721ac3c2da375cbdf4b8679aae" 298 | dependencies = [ 299 | "bytes", 300 | ] 301 | 302 | [[package]] 303 | name = "cc" 304 | version = "1.0.79" 305 | source = "registry+https://github.com/rust-lang/crates.io-index" 306 | checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" 307 | dependencies = [ 308 | "jobserver", 309 | ] 310 | 311 | [[package]] 312 | name = "cfg-if" 313 | version = "1.0.0" 314 | source = "registry+https://github.com/rust-lang/crates.io-index" 315 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 316 | 317 | [[package]] 318 | name = "convert_case" 319 | version = "0.4.0" 320 | source = "registry+https://github.com/rust-lang/crates.io-index" 321 | checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" 322 | 323 | [[package]] 324 | name = "cookie" 325 | version = "0.16.2" 326 | source = "registry+https://github.com/rust-lang/crates.io-index" 327 | checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" 328 | dependencies = [ 329 | "percent-encoding", 330 | "time", 331 | "version_check", 332 | ] 333 | 334 | [[package]] 335 | name = "cpufeatures" 336 | version = "0.2.7" 337 | source = "registry+https://github.com/rust-lang/crates.io-index" 338 | checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" 339 | dependencies = [ 340 | "libc", 341 | ] 342 | 343 | [[package]] 344 | name = "crc32fast" 345 | version = "1.3.2" 346 | source = "registry+https://github.com/rust-lang/crates.io-index" 347 | checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" 348 | dependencies = [ 349 | "cfg-if", 350 | ] 351 | 352 | [[package]] 353 | name = "crypto-common" 354 | version = "0.1.6" 355 | source = "registry+https://github.com/rust-lang/crates.io-index" 356 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 357 | dependencies = [ 358 | "generic-array", 359 | "typenum", 360 | ] 361 | 362 | [[package]] 363 | name = "derive_more" 364 | version = "0.99.17" 365 | source = "registry+https://github.com/rust-lang/crates.io-index" 366 | checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" 367 | dependencies = [ 368 | "convert_case", 369 | "proc-macro2", 370 | "quote", 371 | "rustc_version", 372 | "syn", 373 | ] 374 | 375 | [[package]] 376 | name = "digest" 377 | version = "0.10.6" 378 | source = "registry+https://github.com/rust-lang/crates.io-index" 379 | checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" 380 | dependencies = [ 381 | "block-buffer", 382 | "crypto-common", 383 | ] 384 | 385 | [[package]] 386 | name = "encoding_rs" 387 | version = "0.8.32" 388 | source = "registry+https://github.com/rust-lang/crates.io-index" 389 | checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" 390 | dependencies = [ 391 | "cfg-if", 392 | ] 393 | 394 | [[package]] 395 | name = "fast-async-mutex" 396 | version = "0.6.7" 397 | source = "registry+https://github.com/rust-lang/crates.io-index" 398 | checksum = "b877ceff2e3d2922823bab7960826ce198181f9c25f75d67b913fde9237e2da6" 399 | 400 | [[package]] 401 | name = "flate2" 402 | version = "1.0.25" 403 | source = "registry+https://github.com/rust-lang/crates.io-index" 404 | checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" 405 | dependencies = [ 406 | "crc32fast", 407 | "miniz_oxide", 408 | ] 409 | 410 | [[package]] 411 | name = "fnv" 412 | version = "1.0.7" 413 | source = "registry+https://github.com/rust-lang/crates.io-index" 414 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 415 | 416 | [[package]] 417 | name = "form_urlencoded" 418 | version = "1.1.0" 419 | source = "registry+https://github.com/rust-lang/crates.io-index" 420 | checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" 421 | dependencies = [ 422 | "percent-encoding", 423 | ] 424 | 425 | [[package]] 426 | name = "futures-core" 427 | version = "0.3.28" 428 | source = "registry+https://github.com/rust-lang/crates.io-index" 429 | checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" 430 | 431 | [[package]] 432 | name = "futures-sink" 433 | version = "0.3.28" 434 | source = "registry+https://github.com/rust-lang/crates.io-index" 435 | checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" 436 | 437 | [[package]] 438 | name = "futures-task" 439 | version = "0.3.28" 440 | source = "registry+https://github.com/rust-lang/crates.io-index" 441 | checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" 442 | 443 | [[package]] 444 | name = "futures-util" 445 | version = "0.3.28" 446 | source = "registry+https://github.com/rust-lang/crates.io-index" 447 | checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" 448 | dependencies = [ 449 | "futures-core", 450 | "futures-task", 451 | "pin-project-lite", 452 | "pin-utils", 453 | ] 454 | 455 | [[package]] 456 | name = "generic-array" 457 | version = "0.14.7" 458 | source = "registry+https://github.com/rust-lang/crates.io-index" 459 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 460 | dependencies = [ 461 | "typenum", 462 | "version_check", 463 | ] 464 | 465 | [[package]] 466 | name = "getrandom" 467 | version = "0.2.9" 468 | source = "registry+https://github.com/rust-lang/crates.io-index" 469 | checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" 470 | dependencies = [ 471 | "cfg-if", 472 | "libc", 473 | "wasi", 474 | ] 475 | 476 | [[package]] 477 | name = "h2" 478 | version = "0.3.18" 479 | source = "registry+https://github.com/rust-lang/crates.io-index" 480 | checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" 481 | dependencies = [ 482 | "bytes", 483 | "fnv", 484 | "futures-core", 485 | "futures-sink", 486 | "futures-util", 487 | "http", 488 | "indexmap", 489 | "slab", 490 | "tokio", 491 | "tokio-util", 492 | "tracing", 493 | ] 494 | 495 | [[package]] 496 | name = "hashbrown" 497 | version = "0.12.3" 498 | source = "registry+https://github.com/rust-lang/crates.io-index" 499 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 500 | 501 | [[package]] 502 | name = "hermit-abi" 503 | version = "0.2.6" 504 | source = "registry+https://github.com/rust-lang/crates.io-index" 505 | checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" 506 | dependencies = [ 507 | "libc", 508 | ] 509 | 510 | [[package]] 511 | name = "http" 512 | version = "0.2.9" 513 | source = "registry+https://github.com/rust-lang/crates.io-index" 514 | checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" 515 | dependencies = [ 516 | "bytes", 517 | "fnv", 518 | "itoa", 519 | ] 520 | 521 | [[package]] 522 | name = "httparse" 523 | version = "1.8.0" 524 | source = "registry+https://github.com/rust-lang/crates.io-index" 525 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 526 | 527 | [[package]] 528 | name = "httpdate" 529 | version = "1.0.2" 530 | source = "registry+https://github.com/rust-lang/crates.io-index" 531 | checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" 532 | 533 | [[package]] 534 | name = "idna" 535 | version = "0.3.0" 536 | source = "registry+https://github.com/rust-lang/crates.io-index" 537 | checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" 538 | dependencies = [ 539 | "unicode-bidi", 540 | "unicode-normalization", 541 | ] 542 | 543 | [[package]] 544 | name = "indexmap" 545 | version = "1.9.3" 546 | source = "registry+https://github.com/rust-lang/crates.io-index" 547 | checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" 548 | dependencies = [ 549 | "autocfg", 550 | "hashbrown", 551 | ] 552 | 553 | [[package]] 554 | name = "itoa" 555 | version = "1.0.6" 556 | source = "registry+https://github.com/rust-lang/crates.io-index" 557 | checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" 558 | 559 | [[package]] 560 | name = "jobserver" 561 | version = "0.1.26" 562 | source = "registry+https://github.com/rust-lang/crates.io-index" 563 | checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" 564 | dependencies = [ 565 | "libc", 566 | ] 567 | 568 | [[package]] 569 | name = "language-tags" 570 | version = "0.3.2" 571 | source = "registry+https://github.com/rust-lang/crates.io-index" 572 | checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" 573 | 574 | [[package]] 575 | name = "libc" 576 | version = "0.2.142" 577 | source = "registry+https://github.com/rust-lang/crates.io-index" 578 | checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" 579 | 580 | [[package]] 581 | name = "local-channel" 582 | version = "0.1.3" 583 | source = "registry+https://github.com/rust-lang/crates.io-index" 584 | checksum = "7f303ec0e94c6c54447f84f3b0ef7af769858a9c4ef56ef2a986d3dcd4c3fc9c" 585 | dependencies = [ 586 | "futures-core", 587 | "futures-sink", 588 | "futures-util", 589 | "local-waker", 590 | ] 591 | 592 | [[package]] 593 | name = "local-waker" 594 | version = "0.1.3" 595 | source = "registry+https://github.com/rust-lang/crates.io-index" 596 | checksum = "e34f76eb3611940e0e7d53a9aaa4e6a3151f69541a282fd0dad5571420c53ff1" 597 | 598 | [[package]] 599 | name = "lock_api" 600 | version = "0.4.9" 601 | source = "registry+https://github.com/rust-lang/crates.io-index" 602 | checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" 603 | dependencies = [ 604 | "autocfg", 605 | "scopeguard", 606 | ] 607 | 608 | [[package]] 609 | name = "log" 610 | version = "0.4.17" 611 | source = "registry+https://github.com/rust-lang/crates.io-index" 612 | checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" 613 | dependencies = [ 614 | "cfg-if", 615 | ] 616 | 617 | [[package]] 618 | name = "memchr" 619 | version = "2.5.0" 620 | source = "registry+https://github.com/rust-lang/crates.io-index" 621 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 622 | 623 | [[package]] 624 | name = "mime" 625 | version = "0.3.17" 626 | source = "registry+https://github.com/rust-lang/crates.io-index" 627 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 628 | 629 | [[package]] 630 | name = "miniz_oxide" 631 | version = "0.6.2" 632 | source = "registry+https://github.com/rust-lang/crates.io-index" 633 | checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" 634 | dependencies = [ 635 | "adler", 636 | ] 637 | 638 | [[package]] 639 | name = "mio" 640 | version = "0.8.6" 641 | source = "registry+https://github.com/rust-lang/crates.io-index" 642 | checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" 643 | dependencies = [ 644 | "libc", 645 | "log", 646 | "wasi", 647 | "windows-sys", 648 | ] 649 | 650 | [[package]] 651 | name = "num_cpus" 652 | version = "1.15.0" 653 | source = "registry+https://github.com/rust-lang/crates.io-index" 654 | checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" 655 | dependencies = [ 656 | "hermit-abi", 657 | "libc", 658 | ] 659 | 660 | [[package]] 661 | name = "once_cell" 662 | version = "1.17.1" 663 | source = "registry+https://github.com/rust-lang/crates.io-index" 664 | checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" 665 | 666 | [[package]] 667 | name = "parking_lot" 668 | version = "0.12.1" 669 | source = "registry+https://github.com/rust-lang/crates.io-index" 670 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 671 | dependencies = [ 672 | "lock_api", 673 | "parking_lot_core", 674 | ] 675 | 676 | [[package]] 677 | name = "parking_lot_core" 678 | version = "0.9.7" 679 | source = "registry+https://github.com/rust-lang/crates.io-index" 680 | checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" 681 | dependencies = [ 682 | "cfg-if", 683 | "libc", 684 | "redox_syscall", 685 | "smallvec", 686 | "windows-sys", 687 | ] 688 | 689 | [[package]] 690 | name = "paste" 691 | version = "1.0.12" 692 | source = "registry+https://github.com/rust-lang/crates.io-index" 693 | checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" 694 | 695 | [[package]] 696 | name = "percent-encoding" 697 | version = "2.2.0" 698 | source = "registry+https://github.com/rust-lang/crates.io-index" 699 | checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" 700 | 701 | [[package]] 702 | name = "pin-project-lite" 703 | version = "0.2.9" 704 | source = "registry+https://github.com/rust-lang/crates.io-index" 705 | checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" 706 | 707 | [[package]] 708 | name = "pin-utils" 709 | version = "0.1.0" 710 | source = "registry+https://github.com/rust-lang/crates.io-index" 711 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 712 | 713 | [[package]] 714 | name = "pkg-config" 715 | version = "0.3.26" 716 | source = "registry+https://github.com/rust-lang/crates.io-index" 717 | checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" 718 | 719 | [[package]] 720 | name = "ppv-lite86" 721 | version = "0.2.17" 722 | source = "registry+https://github.com/rust-lang/crates.io-index" 723 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 724 | 725 | [[package]] 726 | name = "proc-macro2" 727 | version = "1.0.56" 728 | source = "registry+https://github.com/rust-lang/crates.io-index" 729 | checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" 730 | dependencies = [ 731 | "unicode-ident", 732 | ] 733 | 734 | [[package]] 735 | name = "quote" 736 | version = "1.0.26" 737 | source = "registry+https://github.com/rust-lang/crates.io-index" 738 | checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" 739 | dependencies = [ 740 | "proc-macro2", 741 | ] 742 | 743 | [[package]] 744 | name = "rand" 745 | version = "0.8.5" 746 | source = "registry+https://github.com/rust-lang/crates.io-index" 747 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 748 | dependencies = [ 749 | "libc", 750 | "rand_chacha", 751 | "rand_core", 752 | ] 753 | 754 | [[package]] 755 | name = "rand_chacha" 756 | version = "0.3.1" 757 | source = "registry+https://github.com/rust-lang/crates.io-index" 758 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 759 | dependencies = [ 760 | "ppv-lite86", 761 | "rand_core", 762 | ] 763 | 764 | [[package]] 765 | name = "rand_core" 766 | version = "0.6.4" 767 | source = "registry+https://github.com/rust-lang/crates.io-index" 768 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 769 | dependencies = [ 770 | "getrandom", 771 | ] 772 | 773 | [[package]] 774 | name = "redox_syscall" 775 | version = "0.2.16" 776 | source = "registry+https://github.com/rust-lang/crates.io-index" 777 | checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 778 | dependencies = [ 779 | "bitflags", 780 | ] 781 | 782 | [[package]] 783 | name = "regex" 784 | version = "1.8.1" 785 | source = "registry+https://github.com/rust-lang/crates.io-index" 786 | checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" 787 | dependencies = [ 788 | "aho-corasick", 789 | "memchr", 790 | "regex-syntax", 791 | ] 792 | 793 | [[package]] 794 | name = "regex-syntax" 795 | version = "0.7.1" 796 | source = "registry+https://github.com/rust-lang/crates.io-index" 797 | checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" 798 | 799 | [[package]] 800 | name = "rust-actix" 801 | version = "0.1.0" 802 | dependencies = [ 803 | "actix-web", 804 | "fast-async-mutex", 805 | ] 806 | 807 | [[package]] 808 | name = "rustc_version" 809 | version = "0.4.0" 810 | source = "registry+https://github.com/rust-lang/crates.io-index" 811 | checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" 812 | dependencies = [ 813 | "semver", 814 | ] 815 | 816 | [[package]] 817 | name = "ryu" 818 | version = "1.0.13" 819 | source = "registry+https://github.com/rust-lang/crates.io-index" 820 | checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" 821 | 822 | [[package]] 823 | name = "scopeguard" 824 | version = "1.1.0" 825 | source = "registry+https://github.com/rust-lang/crates.io-index" 826 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 827 | 828 | [[package]] 829 | name = "semver" 830 | version = "1.0.17" 831 | source = "registry+https://github.com/rust-lang/crates.io-index" 832 | checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" 833 | 834 | [[package]] 835 | name = "serde" 836 | version = "1.0.160" 837 | source = "registry+https://github.com/rust-lang/crates.io-index" 838 | checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" 839 | 840 | [[package]] 841 | name = "serde_json" 842 | version = "1.0.96" 843 | source = "registry+https://github.com/rust-lang/crates.io-index" 844 | checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" 845 | dependencies = [ 846 | "itoa", 847 | "ryu", 848 | "serde", 849 | ] 850 | 851 | [[package]] 852 | name = "serde_urlencoded" 853 | version = "0.7.1" 854 | source = "registry+https://github.com/rust-lang/crates.io-index" 855 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 856 | dependencies = [ 857 | "form_urlencoded", 858 | "itoa", 859 | "ryu", 860 | "serde", 861 | ] 862 | 863 | [[package]] 864 | name = "sha1" 865 | version = "0.10.5" 866 | source = "registry+https://github.com/rust-lang/crates.io-index" 867 | checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" 868 | dependencies = [ 869 | "cfg-if", 870 | "cpufeatures", 871 | "digest", 872 | ] 873 | 874 | [[package]] 875 | name = "signal-hook-registry" 876 | version = "1.4.1" 877 | source = "registry+https://github.com/rust-lang/crates.io-index" 878 | checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" 879 | dependencies = [ 880 | "libc", 881 | ] 882 | 883 | [[package]] 884 | name = "slab" 885 | version = "0.4.8" 886 | source = "registry+https://github.com/rust-lang/crates.io-index" 887 | checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" 888 | dependencies = [ 889 | "autocfg", 890 | ] 891 | 892 | [[package]] 893 | name = "smallvec" 894 | version = "1.10.0" 895 | source = "registry+https://github.com/rust-lang/crates.io-index" 896 | checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" 897 | 898 | [[package]] 899 | name = "socket2" 900 | version = "0.4.9" 901 | source = "registry+https://github.com/rust-lang/crates.io-index" 902 | checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" 903 | dependencies = [ 904 | "libc", 905 | "winapi", 906 | ] 907 | 908 | [[package]] 909 | name = "syn" 910 | version = "1.0.109" 911 | source = "registry+https://github.com/rust-lang/crates.io-index" 912 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 913 | dependencies = [ 914 | "proc-macro2", 915 | "quote", 916 | "unicode-ident", 917 | ] 918 | 919 | [[package]] 920 | name = "time" 921 | version = "0.3.20" 922 | source = "registry+https://github.com/rust-lang/crates.io-index" 923 | checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" 924 | dependencies = [ 925 | "itoa", 926 | "serde", 927 | "time-core", 928 | "time-macros", 929 | ] 930 | 931 | [[package]] 932 | name = "time-core" 933 | version = "0.1.0" 934 | source = "registry+https://github.com/rust-lang/crates.io-index" 935 | checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" 936 | 937 | [[package]] 938 | name = "time-macros" 939 | version = "0.2.8" 940 | source = "registry+https://github.com/rust-lang/crates.io-index" 941 | checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" 942 | dependencies = [ 943 | "time-core", 944 | ] 945 | 946 | [[package]] 947 | name = "tinyvec" 948 | version = "1.6.0" 949 | source = "registry+https://github.com/rust-lang/crates.io-index" 950 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 951 | dependencies = [ 952 | "tinyvec_macros", 953 | ] 954 | 955 | [[package]] 956 | name = "tinyvec_macros" 957 | version = "0.1.1" 958 | source = "registry+https://github.com/rust-lang/crates.io-index" 959 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 960 | 961 | [[package]] 962 | name = "tokio" 963 | version = "1.27.0" 964 | source = "registry+https://github.com/rust-lang/crates.io-index" 965 | checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" 966 | dependencies = [ 967 | "autocfg", 968 | "bytes", 969 | "libc", 970 | "mio", 971 | "parking_lot", 972 | "pin-project-lite", 973 | "signal-hook-registry", 974 | "socket2", 975 | "windows-sys", 976 | ] 977 | 978 | [[package]] 979 | name = "tokio-util" 980 | version = "0.7.7" 981 | source = "registry+https://github.com/rust-lang/crates.io-index" 982 | checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" 983 | dependencies = [ 984 | "bytes", 985 | "futures-core", 986 | "futures-sink", 987 | "pin-project-lite", 988 | "tokio", 989 | "tracing", 990 | ] 991 | 992 | [[package]] 993 | name = "tracing" 994 | version = "0.1.37" 995 | source = "registry+https://github.com/rust-lang/crates.io-index" 996 | checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 997 | dependencies = [ 998 | "cfg-if", 999 | "log", 1000 | "pin-project-lite", 1001 | "tracing-core", 1002 | ] 1003 | 1004 | [[package]] 1005 | name = "tracing-core" 1006 | version = "0.1.30" 1007 | source = "registry+https://github.com/rust-lang/crates.io-index" 1008 | checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" 1009 | dependencies = [ 1010 | "once_cell", 1011 | ] 1012 | 1013 | [[package]] 1014 | name = "typenum" 1015 | version = "1.16.0" 1016 | source = "registry+https://github.com/rust-lang/crates.io-index" 1017 | checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" 1018 | 1019 | [[package]] 1020 | name = "unicode-bidi" 1021 | version = "0.3.13" 1022 | source = "registry+https://github.com/rust-lang/crates.io-index" 1023 | checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" 1024 | 1025 | [[package]] 1026 | name = "unicode-ident" 1027 | version = "1.0.8" 1028 | source = "registry+https://github.com/rust-lang/crates.io-index" 1029 | checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" 1030 | 1031 | [[package]] 1032 | name = "unicode-normalization" 1033 | version = "0.1.22" 1034 | source = "registry+https://github.com/rust-lang/crates.io-index" 1035 | checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" 1036 | dependencies = [ 1037 | "tinyvec", 1038 | ] 1039 | 1040 | [[package]] 1041 | name = "url" 1042 | version = "2.3.1" 1043 | source = "registry+https://github.com/rust-lang/crates.io-index" 1044 | checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" 1045 | dependencies = [ 1046 | "form_urlencoded", 1047 | "idna", 1048 | "percent-encoding", 1049 | ] 1050 | 1051 | [[package]] 1052 | name = "version_check" 1053 | version = "0.9.4" 1054 | source = "registry+https://github.com/rust-lang/crates.io-index" 1055 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1056 | 1057 | [[package]] 1058 | name = "wasi" 1059 | version = "0.11.0+wasi-snapshot-preview1" 1060 | source = "registry+https://github.com/rust-lang/crates.io-index" 1061 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1062 | 1063 | [[package]] 1064 | name = "winapi" 1065 | version = "0.3.9" 1066 | source = "registry+https://github.com/rust-lang/crates.io-index" 1067 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1068 | dependencies = [ 1069 | "winapi-i686-pc-windows-gnu", 1070 | "winapi-x86_64-pc-windows-gnu", 1071 | ] 1072 | 1073 | [[package]] 1074 | name = "winapi-i686-pc-windows-gnu" 1075 | version = "0.4.0" 1076 | source = "registry+https://github.com/rust-lang/crates.io-index" 1077 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1078 | 1079 | [[package]] 1080 | name = "winapi-x86_64-pc-windows-gnu" 1081 | version = "0.4.0" 1082 | source = "registry+https://github.com/rust-lang/crates.io-index" 1083 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1084 | 1085 | [[package]] 1086 | name = "windows-sys" 1087 | version = "0.45.0" 1088 | source = "registry+https://github.com/rust-lang/crates.io-index" 1089 | checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" 1090 | dependencies = [ 1091 | "windows-targets", 1092 | ] 1093 | 1094 | [[package]] 1095 | name = "windows-targets" 1096 | version = "0.42.2" 1097 | source = "registry+https://github.com/rust-lang/crates.io-index" 1098 | checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" 1099 | dependencies = [ 1100 | "windows_aarch64_gnullvm", 1101 | "windows_aarch64_msvc", 1102 | "windows_i686_gnu", 1103 | "windows_i686_msvc", 1104 | "windows_x86_64_gnu", 1105 | "windows_x86_64_gnullvm", 1106 | "windows_x86_64_msvc", 1107 | ] 1108 | 1109 | [[package]] 1110 | name = "windows_aarch64_gnullvm" 1111 | version = "0.42.2" 1112 | source = "registry+https://github.com/rust-lang/crates.io-index" 1113 | checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" 1114 | 1115 | [[package]] 1116 | name = "windows_aarch64_msvc" 1117 | version = "0.42.2" 1118 | source = "registry+https://github.com/rust-lang/crates.io-index" 1119 | checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" 1120 | 1121 | [[package]] 1122 | name = "windows_i686_gnu" 1123 | version = "0.42.2" 1124 | source = "registry+https://github.com/rust-lang/crates.io-index" 1125 | checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" 1126 | 1127 | [[package]] 1128 | name = "windows_i686_msvc" 1129 | version = "0.42.2" 1130 | source = "registry+https://github.com/rust-lang/crates.io-index" 1131 | checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" 1132 | 1133 | [[package]] 1134 | name = "windows_x86_64_gnu" 1135 | version = "0.42.2" 1136 | source = "registry+https://github.com/rust-lang/crates.io-index" 1137 | checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" 1138 | 1139 | [[package]] 1140 | name = "windows_x86_64_gnullvm" 1141 | version = "0.42.2" 1142 | source = "registry+https://github.com/rust-lang/crates.io-index" 1143 | checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" 1144 | 1145 | [[package]] 1146 | name = "windows_x86_64_msvc" 1147 | version = "0.42.2" 1148 | source = "registry+https://github.com/rust-lang/crates.io-index" 1149 | checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" 1150 | 1151 | [[package]] 1152 | name = "zstd" 1153 | version = "0.12.3+zstd.1.5.2" 1154 | source = "registry+https://github.com/rust-lang/crates.io-index" 1155 | checksum = "76eea132fb024e0e13fd9c2f5d5d595d8a967aa72382ac2f9d39fcc95afd0806" 1156 | dependencies = [ 1157 | "zstd-safe", 1158 | ] 1159 | 1160 | [[package]] 1161 | name = "zstd-safe" 1162 | version = "6.0.5+zstd.1.5.4" 1163 | source = "registry+https://github.com/rust-lang/crates.io-index" 1164 | checksum = "d56d9e60b4b1758206c238a10165fbcae3ca37b01744e394c463463f6529d23b" 1165 | dependencies = [ 1166 | "libc", 1167 | "zstd-sys", 1168 | ] 1169 | 1170 | [[package]] 1171 | name = "zstd-sys" 1172 | version = "2.0.8+zstd.1.5.5" 1173 | source = "registry+https://github.com/rust-lang/crates.io-index" 1174 | checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" 1175 | dependencies = [ 1176 | "cc", 1177 | "libc", 1178 | "pkg-config", 1179 | ] 1180 | -------------------------------------------------------------------------------- /rust-actix/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-actix" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | actix-web = "4" 10 | fast-async-mutex = "0.6.7" -------------------------------------------------------------------------------- /rust-actix/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cargo build --release -------------------------------------------------------------------------------- /rust-actix/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec ./target/release/rust-actix -------------------------------------------------------------------------------- /rust-actix/src/main.rs: -------------------------------------------------------------------------------- 1 | use actix_web::{get, web, App, HttpResponse, HttpServer, Responder}; 2 | use std::{ 3 | collections::HashMap, 4 | }; 5 | use fast_async_mutex::mutex::Mutex; 6 | 7 | struct HashCounter { 8 | items: HashMap>, 9 | counter: i32, 10 | } 11 | 12 | const TOTAL: i32 = 250000; 13 | 14 | #[get("/")] 15 | async fn hello(data: web::Data>) -> impl Responder { 16 | let new_data = vec![0_u8; 1024]; 17 | 18 | // Deallocate the old data outside the mutex block 19 | let _old_data = { 20 | let mut full_data = data.lock().await; 21 | 22 | let new_counter = full_data.counter + 1; 23 | full_data.items.insert(new_counter, new_data); 24 | full_data.counter = new_counter; 25 | 26 | if new_counter > TOTAL { 27 | full_data.items.remove(&(new_counter - TOTAL)) 28 | } else { 29 | Option::None 30 | } 31 | }; 32 | 33 | HttpResponse::Ok().body("OK") 34 | } 35 | 36 | #[actix_web::main] 37 | async fn main() -> std::io::Result<()> { 38 | let my_state = web::Data::new(Mutex::new(HashCounter { 39 | items: HashMap::new(), 40 | counter: 0, 41 | })); 42 | 43 | HttpServer::new(move || App::new().app_data(my_state.clone()).service(hello)) 44 | // .workers(1) 45 | .bind(("127.0.0.1", 8080))? 46 | .run() 47 | .await 48 | } 49 | -------------------------------------------------------------------------------- /swift-zewo/.gitignore: -------------------------------------------------------------------------------- 1 | Packages/* 2 | .build 3 | -------------------------------------------------------------------------------- /swift-zewo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(pusher_zewo) 3 | 4 | set(SOURCE_FILES Sources/*.swift) 5 | 6 | add_custom_target( 7 | COMMAND /Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin/swift build 8 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} 9 | SOURCES ) -------------------------------------------------------------------------------- /swift-zewo/Package.swift: -------------------------------------------------------------------------------- 1 | import PackageDescription 2 | 3 | let package = Package( 4 | name: "swift-zewo", 5 | dependencies: [ 6 | .Package(url: "https://github.com/Zewo/Router.git", majorVersion: 0, minor: 5), 7 | .Package(url: "https://github.com/VeniceX/HTTPServer.git", majorVersion: 0, minor: 5) 8 | ] 9 | ) 10 | -------------------------------------------------------------------------------- /swift-zewo/Sources/main.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import HTTPServer 3 | import Router 4 | 5 | var reqNo = 0; 6 | var MAX = 250000; 7 | 8 | var dataBytes = [Int: [Byte]]() 9 | 10 | let app = Router { route in 11 | route.get("/") { _ in 12 | reqNo = reqNo + 1 13 | dataBytes[reqNo] = [Byte](repeating: 25, count: 1024) 14 | if (reqNo >= MAX) { 15 | dataBytes.removeValue(forKey: reqNo - MAX) 16 | } 17 | return Response(body: "OK") 18 | } 19 | } 20 | 21 | try Server(app).start() 22 | -------------------------------------------------------------------------------- /swift-zewo/build.sh: -------------------------------------------------------------------------------- 1 | swift build --configuration release 2 | -------------------------------------------------------------------------------- /swift-zewo/run.sh: -------------------------------------------------------------------------------- 1 | .build/release/swift-zewo 2 | -------------------------------------------------------------------------------- /test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -z "$1" ] 4 | then 5 | programs=$(cat programs.txt) 6 | else 7 | programs=$* 8 | fi 9 | 10 | runtest() { 11 | local program="$1" 12 | echo "Running $program..." 13 | ./run.sh & 14 | local pid=$! 15 | sleep 1 16 | echo "Warming up $program..." 17 | wrk2 --latency -c 99 -t 3 -d 60 -R10000 'http://localhost:8080' | head -n17 18 | echo "Generating $program report..." 19 | wrk2 --latency -c 99 -t 3 -d 210 -R10000 'http://localhost:8080' > "../reports/$program" 20 | grep -E '(VmRSS|VmPeak)' /proc/$pid/status 21 | sleep 1 22 | kill -9 $pid 23 | sleep 2 24 | } 25 | 26 | for program in $programs 27 | do 28 | pushd "$program" 29 | echo "Building $program..." 30 | ./build.sh 31 | runtest "$program" 32 | popd 33 | done 34 | --------------------------------------------------------------------------------