{"id":22680565,"url":"https://github.com/andrehrferreira/bench-ws","last_synced_at":"2025-04-12T15:53:03.506Z","repository":{"id":251891141,"uuid":"838759611","full_name":"andrehrferreira/bench-ws","owner":"andrehrferreira","description":"Websocket performance testing in different languages","archived":false,"fork":false,"pushed_at":"2024-08-14T23:41:40.000Z","size":192522,"stargazers_count":8,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T10:21:27.045Z","etag":null,"topics":["bun","cpp","csharp","dart","deno","elixir","erlang","go","java","node","php","python","ruby","rust","swoole","uwebsocket","websocket","zig"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrehrferreira.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-08-06T09:34:21.000Z","updated_at":"2025-03-12T12:40:49.000Z","dependencies_parsed_at":"2024-08-12T23:55:01.160Z","dependency_job_id":null,"html_url":"https://github.com/andrehrferreira/bench-ws","commit_stats":null,"previous_names":["andrehrferreira/bench-ws"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrehrferreira%2Fbench-ws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrehrferreira%2Fbench-ws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrehrferreira%2Fbench-ws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrehrferreira%2Fbench-ws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrehrferreira","download_url":"https://codeload.github.com/andrehrferreira/bench-ws/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248592094,"owners_count":21130179,"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","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":["bun","cpp","csharp","dart","deno","elixir","erlang","go","java","node","php","python","ruby","rust","swoole","uwebsocket","websocket","zig"],"created_at":"2024-12-09T19:14:05.581Z","updated_at":"2025-04-12T15:53:03.478Z","avatar_url":"https://github.com/andrehrferreira.png","language":"JavaScript","readme":"Benchmark Websocket\r\n=========================\r\n\r\nThe result so far is an Intel Core i9 10980XE desktop, 256GB DDR RAM, individual Docker configuration for each server, 2024-08-14\r\n\r\n| (index) |       Server       | Avg Messages/sec | % Difference |\r\n|:-------:|:------------------:|:----------------:|:------------:|\r\n|    0    |       Rust         |    1,438,459.2   |    247.87%   |\r\n|    1    |       Java         |    1,136,289.2   |    174.79%   |\r\n|    2    |       C#           |     876,244.4    |    111.91%   |\r\n|    3    | C++ (Crow + TBB)   |     484,825.4    |     17.25%   |\r\n|    4    |   PHP / Swoole     |     473,327      |     14.47%   |\r\n|    5    | Erlang / Elixir    |     348,513.2    |    -15.72%   |\r\n|    6    |   Go (Gorilla)     |     253,044.8    |    -38.81%   |\r\n|    7    |       Bun          |     230,723.2    |    -44.20%   |\r\n|    8    |  uWebsocket.js     |     225,335.6    |    -45.51%   |\r\n|    9    |  Go (Fasthttp)     |     191,886      |    -53.60%   |\r\n|   10    |       Node         |     124,721.6    |    -69.84%   |\r\n|   11    |       Ruby         |      3,557.8     |    -99.14%   |\r\n|   12    |     Python3        |      1,177       |    -99.72%   | // Need revision\r\n|   13    |       Dart         |       980        |    -99.76%   | // Need revision\r\n\r\n\r\nThe result so far is an Intel Core i9 10980XE desktop, 256GB DDR RAM, individual Docker configuration for each server\r\n\r\n| (index) | Server           | Avg Messages/sec | % Difference |\r\n|---------|------------------|------------------|--------------|\r\n| 0       | Rust             | 1,232,041.4      | 541.60%      |\r\n| 1       | Java             | 1,175,892        | 516.41%      |\r\n| 2       | C#               | 1,132,847.8      | 496.48%      |\r\n| 3       | C++ (Crow + TBB) | 504,620.8        | 157.50%      |\r\n| 4       | PHP / Swoole     | 485,236.6        | 149.58%      |\r\n| 5       | Erlang / Elixir  | 296,681.2        | 66.95%       |\r\n| 6       | Bun              | 266,875.2        | 53.20%       |\r\n| 7       | Go               | 263,391.2        | 51.51%       |\r\n| 8       | Python3          | 191,937          | 16.15%       |\r\n| 9       | Node             | 154,831.2        | -4.33%       |\r\n| 10      | uWebsocket.js    | 100,140.4        | -33.47%      |\r\n| 11      | Dart             | 6,936.8          | -95.12%      |\r\n| 12      | Ruby             | 3,456.4          | -97.51%      |\r\n\r\nThe result so far is an Intel Core i9 10980XE desktop, 256GB of DDR RAM, using WSL and manual configuration.\r\n\r\n|    | Server           | Avg Messages/sec | % Difference |\r\n|----|------------------|------------------|--------------|\r\n|  0 | Rust             | 990,420.4        | 315.79%      |\r\n|  1 | C#               | 871,702.6        | 265.95%      |\r\n|  2 | Erlang / Elixir  | 654,033.6        | 156.37%      |\r\n|  3 | C++ (Crow + TBB) | 518,418.2        | 90.88%       |\r\n|  4 | Java             | 146,882.6        | -57.73%      |\r\n|  5 | Bun              | 88,682.2         | -76.19%      |\r\n|  6 | Go               | 87,612.8         | -76.53%      |\r\n|  7 | uWebsocket.js    | 82,604.8         | -78.24%      |\r\n|  8 | PHP / Swoole     | 80,273.8         | -79.00%      |\r\n|  9 | Python3          | 72,891.0         | -81.36%      |\r\n| 10 | Node             | 63,003.6         | -84.76%      |\r\n| 11 | * Deno           | 61,819.0         | -85.18%      |\r\n \r\n\r\n* Deno has been removed from testing due to memory leek and poor performance issues\r\n\r\n* Soon implementations in Zig \r\n\r\nRun in Node\r\n-------------\r\n\r\n```bash\r\n$ node server-node.js\r\n```\r\n\r\nRun in uWebsocket.js\r\n-------------\r\n\r\n```bash\r\n$ node server-uws.js\r\n```\r\n\r\nRun in Deno\r\n-------------\r\n\r\n```bash\r\n$ deno run -A server-deno.mjs\r\n```\r\n\r\nRun in Bun\r\n-------------\r\n\r\n```bash\r\n$ bun server-bun.js\r\n```\r\n\r\nRun in C#\r\n-------------\r\n\r\nBuild\r\n```bash\r\n$ cd server-csharp \r\n$ dotnet build\r\n```\r\n\r\nRun\r\n```bash\r\n$ dotnet run\r\n```\r\n\r\nRun in Erlang / Elixir\r\n-------------\r\n\r\nDepedences \r\n```bash\r\n$ mix deps.get \r\n```\r\n\r\nBuild\r\n```bash\r\n$ cd server_elixir\r\n$ mix deps.compile\r\n```\r\n\r\nRun\r\n```bash\r\n$ mix run --no-halt\r\n```\r\n\r\nRun in Phyton 3\r\n-------------\r\n\r\nDepedences \r\n```bash\r\n$ pip install gevent\r\n$ pip install gevent-websocket\r\n```\r\n\r\nRun\r\n```bash\r\n$ cd server-python\r\n$ python server-python.py\r\n```\r\n\r\nRun in Rust\r\n-------------\r\n\r\nBuild\r\n```bash\r\n$ cd server-rust\r\n$ cargo build --release\r\n```\r\n\r\nRun\r\n```bash\r\n$ ./target/release/server-rust\r\n```\r\n\r\nRun in Java\r\n-------------\r\n\r\nBuild\r\n```bash\r\n$ cd server-java\r\n$ mvn compile\r\n```\r\n\r\nRun\r\n```bash\r\n$ java -jar server-java/target/server-1.0-SNAPSHOT-jar-with-dependencies.jar\r\n```\r\n\r\nRun in Go\r\n-------------\r\n\r\nBuild\r\n```bash\r\n$ cd server-go\r\n$ go build\r\n```\r\n\r\nRun\r\n```bash\r\n$ ./server\r\n```\r\n\r\nRun in C++ (Crow + TBB)\r\n-------------\r\n\r\nDependeces \r\n```bash\r\n$ vcpkg install\r\n```\r\n\r\nRun\r\n```bash\r\n$ server-cpp/x64/Release/server-cpp.exe\r\n```\r\n\r\nRun in PHP / Swoole\r\n-------------\r\n\r\nRun\r\n```bash\r\n$ php ./server-swoole/server.php\r\n```\r\n\r\n## Client \r\n\r\nTo start the test it will be necessary to start all the servers, each one is configured on a port\r\n\r\n```bash\r\n$ bun ./client.js\r\n```\r\n\r\nThe test script will perform local tests and send and broadcast messages and will store the total number of messages received per second. It will also generate a comparison between all tested servers, summarizing the average number of messages per second and the comparative performance to other servers.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrehrferreira%2Fbench-ws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrehrferreira%2Fbench-ws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrehrferreira%2Fbench-ws/lists"}