{"id":18579039,"url":"https://github.com/lpeterse/network-socket-performance","last_synced_at":"2025-08-04T08:34:21.354Z","repository":{"id":66327460,"uuid":"116116748","full_name":"lpeterse/network-socket-performance","owner":"lpeterse","description":"Comparing network and socket wrt to performance","archived":false,"fork":false,"pushed_at":"2018-01-03T13:50:32.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-16T02:12:46.588Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lpeterse.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-03T09:13:59.000Z","updated_at":"2018-01-03T13:50:33.000Z","dependencies_parsed_at":"2023-03-10T23:49:53.192Z","dependency_job_id":null,"html_url":"https://github.com/lpeterse/network-socket-performance","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lpeterse/network-socket-performance","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpeterse%2Fnetwork-socket-performance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpeterse%2Fnetwork-socket-performance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpeterse%2Fnetwork-socket-performance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpeterse%2Fnetwork-socket-performance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lpeterse","download_url":"https://codeload.github.com/lpeterse/network-socket-performance/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpeterse%2Fnetwork-socket-performance/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268670492,"owners_count":24288003,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T23:38:44.864Z","updated_at":"2025-08-04T08:34:21.239Z","avatar_url":"https://github.com/lpeterse.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# network-socket-performance\n\nRun `stack bench`!\n\nThere are some parameters to play with in the source file - feel free to modify them!\n\n## Results\n\nMy machine is a **Lenovo x230** with **Intel(R) Core(TM) i7-3520M CPU** and **8GB RAM**. Your results may differ.\n\n| _half-duplex/full-duplex_ | network       | socket         | network (threaded) | socket (threaded) |\n|---------------------------|---------------|----------------|--------------------|-------------------|\n| _chunkSize=40 bytes_      | 226ms / 453ms | 285ms / 1013ms | 374ms / 833ms      | 553ms / 1223ms    |\n| _chunkSize=4000 bytes_    | 20ms / 38ms   | 21ms / 47ms    | 21ms / 42ms        | 21ms / 41ms       |\n\n### `chunkSize=4000, iterations=250*1000, concurrency=1 (non-threaded)`\n\n```\nbenchmarking transmission of 1000 MB (in chunks of 4 kB) over an Inet4-TCP-Socket (half-duplex) with concurrency 1/socket\ntime                 100.5 ms   (73.92 ms .. 171.3 ms)\n                     0.970 R²   (0.966 R² .. 1.000 R²)\nmean                 187.7 ms   (129.9 ms .. 259.7 ms)\nstd dev              66.02 ms   (0.0 s .. 74.90 ms)\nvariance introduced by outliers: 73% (severely inflated)\n             \nbenchmarking transmission of 1000 MB (in chunks of 4 kB) over an Inet4-TCP-Socket (half-duplex) with concurrency 1/network\ntime                 95.65 ms   (70.11 ms .. 165.5 ms)\n                     0.968 R²   (0.965 R² .. 1.000 R²)\nmean                 178.4 ms   (123.3 ms .. 219.7 ms)\nstd dev              63.04 ms   (0.0 s .. 71.50 ms)\nvariance introduced by outliers: 73% (severely inflated)\n             \nbenchmarking transmission of 1000 MB (in chunks of 4 kB) in each direction over an Inet4-TCP-Socket (full-duplex) with concurrency 1/socket\ntime                 221.5 ms   (169.7 ms .. 404.8 ms)\n                     0.967 R²   (0.951 R² .. 1.000 R²)\nmean                 425.9 ms   (290.8 ms .. 529.6 ms)\nstd dev              159.5 ms   (0.0 s .. 179.6 ms)\nvariance introduced by outliers: 73% (severely inflated)\n             \nbenchmarking transmission of 1000 MB (in chunks of 4 kB) in each direction over an Inet4-TCP-Socket (full-duplex) with concurrency 1/network\ntime                 190.9 ms   (140.3 ms .. 329.6 ms)\n                     0.968 R²   (0.966 R² .. 1.000 R²)\nmean                 355.3 ms   (245.9 ms .. 437.2 ms)\nstd dev              125.2 ms   (0.0 s .. 142.0 ms)\nvariance introduced by outliers: 73% (severely inflated)\n```\n\n### `chunkSize=4000, iterations=250*1000, concurrency=1 (-threaded -with-rtsopts=-N2)`\n\n```\nbenchmarking transmission of 1000 MB (in chunks of 4 kB) over an Inet4-TCP-Socket (half-duplex) with concurrency 1/socket\ntime                 116.9 ms   (67.49 ms .. 233.4 ms)\n                     0.934 R²   (0.923 R² .. 1.000 R²)\nmean                 233.3 ms   (152.5 ms .. 292.2 ms)\nstd dev              89.15 ms   (0.0 s .. 101.9 ms)\nvariance introduced by outliers: 73% (severely inflated)\n             \nbenchmarking transmission of 1000 MB (in chunks of 4 kB) over an Inet4-TCP-Socket (half-duplex) with concurrency 1/network\ntime                 101.3 ms   (86.65 ms .. 155.6 ms)\n                     0.986 R²   (0.975 R² .. 1.000 R²)\nmean                 172.9 ms   (126.8 ms .. 208.6 ms)\nstd dev              55.02 ms   (0.0 s .. 61.77 ms)\nvariance introduced by outliers: 73% (severely inflated)\n             \nbenchmarking transmission of 1000 MB (in chunks of 4 kB) in each direction over an Inet4-TCP-Socket (full-duplex) with concurrency 1/socket\ntime                 211.7 ms   (123.5 ms .. 320.9 ms)\n                     0.955 R²   (0.926 R² .. 1.000 R²)\nmean                 392.4 ms   (270.3 ms .. 476.4 ms)\nstd dev              126.3 ms   (0.0 s .. 145.6 ms)\nvariance introduced by outliers: 73% (severely inflated)\n             \nbenchmarking transmission of 1000 MB (in chunks of 4 kB) in each direction over an Inet4-TCP-Socket (full-duplex) with concurrency 1/network\ntime                 221.2 ms   (146.9 ms .. 519.9 ms)\n                     0.936 R²   (0.831 R² .. 1.000 R²)\nmean                 447.4 ms   (294.4 ms .. 668.9 ms)\nstd dev              196.4 ms   (0.0 s .. 216.2 ms)\nvariance introduced by outliers: 74% (severely inflated)\n```\n\n### `chunkSize=4000, iterations=50*1000, concurrency=5 (non-threaded)`\n\n```\nbenchmarking transmission of 200 MB (in chunks of 4 kB) over an Inet4-TCP-Socket (half-duplex) with concurrency 5/socket\ntime                 21.74 ms   (13.63 ms .. 37.65 ms)\n                     0.954 R²   (0.940 R² .. 1.000 R²)\nmean                 40.47 ms   (27.64 ms .. 49.67 ms)\nstd dev              13.90 ms   (0.0 s .. 15.93 ms)\nvariance introduced by outliers: 73% (severely inflated)\n             \nbenchmarking transmission of 200 MB (in chunks of 4 kB) over an Inet4-TCP-Socket (half-duplex) with concurrency 5/network\ntime                 20.78 ms   (18.08 ms .. 35.96 ms)\n                     0.979 R²   (0.945 R² .. 1.000 R²)\nmean                 37.62 ms   (26.73 ms .. 46.27 ms)\nstd dev              13.47 ms   (0.0 s .. 14.98 ms)\nvariance introduced by outliers: 73% (severely inflated)\n             \nbenchmarking transmission of 200 MB (in chunks of 4 kB) in each direction over an Inet4-TCP-Socket (full-duplex) with concurrency 5/socket\ntime                 47.27 ms   (31.64 ms .. 70.41 ms)\n                     0.969 R²   (0.954 R² .. 1.000 R²)\nmean                 93.78 ms   (63.79 ms .. 115.4 ms)\nstd dev              32.76 ms   (0.0 s .. 37.50 ms)\nvariance introduced by outliers: 73% (severely inflated)\n             \nbenchmarking transmission of 200 MB (in chunks of 4 kB) in each direction over an Inet4-TCP-Socket (full-duplex) with concurrency 5/network\ntime                 38.08 ms   (30.91 ms .. 72.96 ms)\n                     0.965 R²   (0.927 R² .. 1.000 R²)\nmean                 76.33 ms   (51.40 ms .. 110.2 ms)\nstd dev              30.44 ms   (0.0 s .. 33.98 ms)\nvariance introduced by outliers: 74% (severely inflated)\n```\n\n### `chunkSize=4000, iterations=50*1000, concurrency=5 (-threaded -with-rtsopts=-N2)`\n\n```\nbenchmarking transmission of 200 MB (in chunks of 4 kB) over an Inet4-TCP-Socket (half-duplex) with concurrency 5/socket\ntime                 21.72 ms   (13.12 ms .. 41.26 ms)\n                     0.943 R²   (0.932 R² .. 1.000 R²)\nmean                 42.02 ms   (27.98 ms .. 52.21 ms)\nstd dev              15.43 ms   (0.0 s .. 17.65 ms)\nvariance introduced by outliers: 73% (severely inflated)\n             \nbenchmarking transmission of 200 MB (in chunks of 4 kB) over an Inet4-TCP-Socket (half-duplex) with concurrency 5/network\ntime                 21.38 ms   (8.524 ms .. 33.38 ms)\n                     0.920 R²   (0.818 R² .. 1.000 R²)\nmean                 38.95 ms   (26.57 ms .. 46.65 ms)\nstd dev              11.63 ms   (0.0 s .. 13.33 ms)\nvariance introduced by outliers: 73% (severely inflated)\n             \nbenchmarking transmission of 200 MB (in chunks of 4 kB) in each direction over an Inet4-TCP-Socket (full-duplex) with concurrency 5/socket\ntime                 41.55 ms   (10.80 ms .. 84.50 ms)\n                     0.866 R²   (0.752 R² .. 1.000 R²)\nmean                 85.09 ms   (53.01 ms .. 106.2 ms)\nstd dev              31.70 ms   (0.0 s .. 36.59 ms)\nvariance introduced by outliers: 73% (severely inflated)\n             \nbenchmarking transmission of 200 MB (in chunks of 4 kB) in each direction over an Inet4-TCP-Socket (full-duplex) with concurrency 5/network\ntime                 42.05 ms   (NaN s .. 94.90 ms)\n                     0.943 R²   (0.852 R² .. 1.000 R²)\nmean                 83.48 ms   (55.53 ms .. 106.1 ms)\nstd dev              35.59 ms   (0.0 s .. 39.27 ms)\nvariance introduced by outliers: 74% (severely inflated)\n```\n\n### `chunkSize=40, iterations=5000*1000, concurrency=5 (non-threaded)`\n\n```\ntime                 285.0 ms   (210.4 ms .. 491.7 ms)\n                     0.969 R²   (0.967 R² .. 1.000 R²)\nmean                 531.2 ms   (367.6 ms .. 654.0 ms)\nstd dev              187.6 ms   (55.51 as .. 212.7 ms)\nvariance introduced by outliers: 73% (severely inflated)\n             \nbenchmarking transmission of 200 MB (in chunks of 40 bytes) over an Inet4-TCP-Socket (half-duplex) with concurrency 5/network\ntime                 226.6 ms   (155.9 ms .. 383.5 ms)\n                     0.965 R²   (0.956 R² .. 1.000 R²)\nmean                 424.3 ms   (292.0 ms .. 521.3 ms)\nstd dev              147.3 ms   (0.0 s .. 168.1 ms)\nvariance introduced by outliers: 73% (severely inflated)\n             \nbenchmarking transmission of 200 MB (in chunks of 40 bytes) in each direction over an Inet4-TCP-Socket (full-duplex) with concurrency 5/socket\ntime                 1.013 s    (649.7 ms .. 1.711 s)\n                     0.958 R²   (0.944 R² .. 1.000 R²)\nmean                 2.044 s    (1.363 s .. 2.539 s)\nstd dev              751.5 ms   (0.0 s .. 858.6 ms)\nvariance introduced by outliers: 73% (severely inflated)\n             \nbenchmarking transmission of 200 MB (in chunks of 40 bytes) in each direction over an Inet4-TCP-Socket (full-duplex) with concurrency 5/network\ntime                 453.9 ms   (338.4 ms .. 776.2 ms)\n                     0.970 R²   (0.968 R² .. 1.000 R²)\nmean                 842.0 ms   (584.8 ms .. 1.035 s)\nstd dev              295.5 ms   (0.0 s .. 334.8 ms)\n```\n\n### `chunkSize=40, iterations=5000*1000, concurrency=5 (-threaded -with-rtsopts=-N2)`\n\n```\nbenchmarking transmission of 200 MB (in chunks of 40 bytes) over an Inet4-TCP-Socket (half-duplex) with concurrency 5/socket\ntime                 553.3 ms   (407.9 ms .. 1.310 s)\n                     0.930 R²   (0.852 R² .. 1.000 R²)\nmean                 1.168 s    (751.7 ms .. 1.501 s)\nstd dev              518.5 ms   (0.0 s .. 575.8 ms)\nvariance introduced by outliers: 74% (severely inflated)\n             \nbenchmarking transmission of 200 MB (in chunks of 40 bytes) over an Inet4-TCP-Socket (half-duplex) with concurrency 5/network\ntime                 374.4 ms   (288.9 ms .. 717.0 ms)\n                     0.962 R²   (0.936 R² .. 1.000 R²)\nmean                 730.8 ms   (494.4 ms .. 914.0 ms)\nstd dev              282.6 ms   (0.0 s .. 317.2 ms)\nvariance introduced by outliers: 74% (severely inflated)\n             \nbenchmarking transmission of 200 MB (in chunks of 40 bytes) in each direction over an Inet4-TCP-Socket (full-duplex) with concurrency 5/socket\ntime                 1.223 s    (842.4 ms .. 2.063 s)\n                     0.965 R²   (0.956 R² .. 1.000 R²)\nmean                 2.218 s    (1.544 s .. 3.018 s)\nstd dev              745.0 ms   (0.0 s .. 850.8 ms)\nvariance introduced by outliers: 73% (severely inflated)\n             \nbenchmarking transmission of 200 MB (in chunks of 40 bytes) in each direction over an Inet4-TCP-Socket (full-duplex) with concurrency 5/network\ntime                 833.9 ms   (591.4 ms .. 1.419 s)\n                     0.967 R²   (0.961 R² .. 1.000 R²)\nmean                 1.553 s    (1.073 s .. 1.908 s)\nstd dev              540.6 ms   (0.0 s .. 615.2 ms)\nvariance introduced by outliers: 73% (severely inflated)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpeterse%2Fnetwork-socket-performance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flpeterse%2Fnetwork-socket-performance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpeterse%2Fnetwork-socket-performance/lists"}