{"id":28424106,"url":"https://github.com/unetworking/pubsub-benchmark","last_synced_at":"2025-06-25T11:30:49.201Z","repository":{"id":66131390,"uuid":"214083024","full_name":"uNetworking/pubsub-benchmark","owner":"uNetworking","description":"Simplified stock exchange as pubsub benchmark","archived":false,"fork":false,"pushed_at":"2019-10-11T02:44:23.000Z","size":26,"stargazers_count":44,"open_issues_count":0,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-05T09:43:38.125Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/uNetworking.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}},"created_at":"2019-10-10T04:01:31.000Z","updated_at":"2024-01-25T13:37:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"72f29c4e-b239-443d-89b3-41893e4824e0","html_url":"https://github.com/uNetworking/pubsub-benchmark","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/uNetworking/pubsub-benchmark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uNetworking%2Fpubsub-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uNetworking%2Fpubsub-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uNetworking%2Fpubsub-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uNetworking%2Fpubsub-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uNetworking","download_url":"https://codeload.github.com/uNetworking/pubsub-benchmark/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uNetworking%2Fpubsub-benchmark/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261862903,"owners_count":23221445,"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":[],"created_at":"2025-06-05T09:36:29.147Z","updated_at":"2025-06-25T11:30:49.194Z","avatar_url":"https://github.com/uNetworking.png","language":"JavaScript","readme":"# Simplified stock exchange as pubsub benchmark\n\nThis repo implements a simplified stock exchange service using pub/sub support found in Socket.IO and uWebSockets.js. The purpose is to showcase performance differences in the two projects given a real-world example under stressful conditions.\n\nThe benchmark is simple; two versions are made using virtually identical features and number of lines of code. One made with uWebSockets.js, one made with Socket.IO. Source code is available under respective folder. Feel free to PR other implementations.\n\n\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"TransactionsPerSecond.png\"/\u003e\n\n\u003c/div\u003e\n\n*Note: uWebSockets.js cannot be fully stressed with the WebSocket client \"websockets/ws\" in use here, so results reported are not ideal. However the difference is grand in any case, so let's not get caught up in details.*\n\n## Details\n\n#### The server\nHolds a set of 5 shares with their respective value. If a share is bought, its value increases by 0.1%. Likewise if a share is sold, its value decreases by 0.1%. Every share is its own topic (or so called \"room\"); when a share value changes its value is published to all subscribers of that topic.\n\n#### The client (passive watchers and active traders)\nEstablishes 500 connections, of which 50 are active traders and 450 are passive watchers. Every connection is interested in only one share, and will only subscribe to, and buy/sell that one share.\n\nActive traders buy/sell their share every 1ms, driving change in the market. Passive watchers do not buy/sell but only watches the value of its share.\n\n#### The metrics\nPerformance is measured in transactions per second, server side. More detailed metrics could be added, however the difference in performance is so grand that it makes little sense to care about the details here. We just want you to get the big picture, and back it up with scientific measures, open source for anyone to confirm or deny.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funetworking%2Fpubsub-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funetworking%2Fpubsub-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funetworking%2Fpubsub-benchmark/lists"}