{"id":32662608,"url":"https://github.com/space-pup/quicksand","last_synced_at":"2026-05-06T10:32:41.277Z","repository":{"id":320899951,"uuid":"1083707626","full_name":"space-pup/quicksand","owner":"space-pup","description":"A communication library letting robots think at the speed of silicon! See quicksand.wiki","archived":false,"fork":false,"pushed_at":"2025-10-26T15:52:10.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-26T17:30:38.206Z","etag":null,"topics":["communication","message","pub","robotics","ros","sub"],"latest_commit_sha":null,"homepage":"https://quicksand.wiki","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/space-pup.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-26T15:10:18.000Z","updated_at":"2025-10-26T15:52:14.000Z","dependencies_parsed_at":"2025-10-26T17:41:51.189Z","dependency_job_id":null,"html_url":"https://github.com/space-pup/quicksand","commit_stats":null,"previous_names":["space-pup/quicksand"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/space-pup/quicksand","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-pup%2Fquicksand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-pup%2Fquicksand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-pup%2Fquicksand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-pup%2Fquicksand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/space-pup","download_url":"https://codeload.github.com/space-pup/quicksand/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-pup%2Fquicksand/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":282049664,"owners_count":26605488,"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-10-31T02:00:07.401Z","response_time":57,"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":["communication","message","pub","robotics","ros","sub"],"created_at":"2025-10-31T20:00:55.421Z","updated_at":"2025-10-31T20:01:59.595Z","avatar_url":"https://github.com/space-pup.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quicksand 🏜️\n\nA multiple-reader multiple-writer communication library enabling robots to think at the speed of silicon!\n\nWe have benchmarked processing over 20 million messages per second per process on a on a 2020 laptop processor (i7-1165G7 @ 2.80GHz). This library uses a lock-free shared-memory ring buffer in order to perform inter-process message passing significantly faster than other libraries.\n\n## Usage - Python\n\nPublisher - Python\n```Python\nimport quicksand as qs\n\nqs.delete(\"hi_topic\")\nc = qs.connection(\"hi_topic\", 8, 1000000)\n\nwhile True:\n    c.write(b\"hello\")\n```\n\nSubscriber - Python:\n```Python\nimport quicksand as qs\n\nc = qs.connection(\"hi_topic\", -1, -1)\ncount = 0\nstart = qs.now()\n\nc.read_latest()\nwhile True:\n    for msg in c:\n        if msg ==  b\"hello\":\n            count += 1\n    dt = qs.ns_elapsed(start)\n    if dt \u003e 1e9:\n        print(count / (dt * 1e-9), \"msgs/s\")\n        count = 0\n        start = qs.now()\n```\n\nOutput (Python 3.10, Clang 14.0.0, i7-1165G7 @ 2.80GHz):\n```\n1136568.6862551533 msgs/s\n1524979.1982293406 msgs/s\n1536257.701024759 msgs/s\n1516702.770531038 msgs/s\n1517196.7936193675 msgs/s\n1500912.66844739 msgs/s\n```\n\n## Usage - C\n\nPublisher example - C\n```C\n#include \u003cassert.h\u003e\n#include \u003csignal.h\u003e\n#include \u003cstdio.h\u003e\n\n#include \"quicksand.h\"\n\n\nstatic volatile int ok = 1;\n\nvoid interrupt()\n{\n\tok = 0;\n}\n\nint main()\n{\n\tsignal(SIGINT, interrupt);\n\tquicksand_connection *writer = NULL;\n\tint64_t rate = 1000000; // 1 million msgs/s\n\tint64_t success = quicksand_connect(\u0026writer, \"test_pubsub\", -1, 8, rate, NULL);\n\tassert(success == 0 \u0026\u0026 writer);\n\n\tint32_t data = 0;\n\n\tdouble delay = 1.0 / (f64) rate * 1e9;\n\twhile(ok) {\n\t\tuint64_t start = quicksand_now();\n\t\tint64_t ret = quicksand_write(writer, (uint8_t *) \u0026data, sizeof(data));\n\t\tif(ret != 0) {\n\t\t\tcontinue;\n\t\t}\n\t\tdata = (data + 1) \u0026 (32768 - 1); // modulo\n\t\tquicksand_sleep(delay - quicksand_ns(quicksand_now(), start));\n\t}\n\n\tquicksand_disconnect(\u0026writer, NULL);\n\tquicksand_delete(\"test_pubsub\", -1);\n\treturn 0;\n}\n```\n\n\nSubscriber example - C\n```C\n#include \u003cassert.h\u003e\n#include \u003csignal.h\u003e\n#include \u003cstdio.h\u003e\n\n#include \"quicksand.h\"\n\nstatic volatile int ok = 1;\n\nvoid interrupt()\n{\n\tok = 0;\n}\n\nint main()\n{\n\tsignal(SIGINT, interrupt);\n\tquicksand_connection *reader = NULL;\n\tint64_t disconnected = 1;\n\twhile(ok \u0026\u0026 disconnected) {\n\t\tdisconnected = quicksand_connect(\u0026reader, \"test_pubsub\", -1,\n\t\t\t\t-1, -1, NULL);\n\t}\n\tassert(disconnected == 0 \u0026\u0026 reader);\n\n\tuint64_t start = quicksand_now();\n\tuint64_t count = 0;\n\tuint64_t skipcount = 0;\n\tint32_t data = 0;\n\tint64_t size = sizeof(data);\n\tint32_t last = 0;\n\twhile(ok) {\n\t\tint64_t ret = quicksand_read(reader, (uint8_t *) \u0026data, \u0026size);\n\t\tif(ret \u003e -1) {\n\t\t\tcount += 1;\n\t\t\tskipcount += (uint64_t) (data != ((last + 1) \u0026 (32768 - 1)));\n\t\t\tlast = data;\n\t\t}\n\n\t\tdouble ns = quicksand_ns(quicksand_now(), start);\n\t\tif(ns \u003e 1e9) {\n\t\t\tprintf(\"%f msgs/s (drop: %f %%)\\n\",\n\t\t\t       (double) count / (ns * 1e-9),\n\t\t\t       (double) skipcount / (double) count * 100.0);\n\t\t\tcount = 0;\n\t\t\tskipcount = 0;\n\t\t\tstart = quicksand_now();\n\t\t}\n\t}\n\n\tquicksand_disconnect(\u0026reader, NULL);\n\treturn 0;\n}\n```\n\n\nRunning:\n\n* Terminal 1:\n```\nmake build/test/pub\nmake build/test/sub\n./build/test/sub\n```\n* Terminal 2:\n```\n./build/test/pub\n```\n\n* Terminal 3:\n```\n./build/test/pub\n```\n\nOutput:\n```\n$ ./build/test/sub\n999397.986483 msgs/s (drop: 0.000100 %)\n1003744.982127 msgs/s (drop: 0.000000 %)\n1005704.982092 msgs/s (drop: 0.000000 %)\n1749063.970103 msgs/s (drop: 83.113197 %)\n1998851.997210 msgs/s (drop: 97.216402 %)\n1998569.991506 msgs/s (drop: 97.370070 %)\n```\n*(Note: the Drop % calculation assumes one publisher.)*\n\nRemoving the sleep from the test_pub.c and running with only one publisher can result in the following messaging rate using Clang 14.0.0 on a 2020 laptop processor (i7-1165G7 @ 2.80GHz):\n\n```\n$ ./build/test/sub\n18603454.891196 msgs/s (drop: 0.000005 %)\n20161391.342656 msgs/s (drop: 0.000000 %)\n20459358.354837 msgs/s (drop: 0.000005 %)\n19552304.997248 msgs/s (drop: 0.000000 %)\n20273548.563203 msgs/s (drop: 0.000000 %)\n20429499.443235 msgs/s (drop: 0.000000 %)\n```\n\n## Installation\n\nInstall library:\n```\nmake\nmake check\nsudo make install\n```\n\nPython install (after library install):\n```\ncd lang/python \u0026\u0026 pip install .\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspace-pup%2Fquicksand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspace-pup%2Fquicksand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspace-pup%2Fquicksand/lists"}