{"id":14222216,"url":"https://github.com/df308/x9","last_synced_at":"2025-08-09T16:32:14.165Z","repository":{"id":173366319,"uuid":"650627921","full_name":"df308/x9","owner":"df308","description":"high performance message passing library","archived":false,"fork":false,"pushed_at":"2024-07-28T12:16:41.000Z","size":23,"stargazers_count":256,"open_issues_count":0,"forks_count":18,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-08-20T19:27:30.688Z","etag":null,"topics":["high-frequency-trading","high-performance-computing","low-latency","ultra-low-latency"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/df308.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}},"created_at":"2023-06-07T13:18:19.000Z","updated_at":"2024-08-18T12:38:42.000Z","dependencies_parsed_at":"2023-07-20T03:45:53.532Z","dependency_job_id":null,"html_url":"https://github.com/df308/x9","commit_stats":null,"previous_names":["df308/x9"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/df308%2Fx9","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/df308%2Fx9/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/df308%2Fx9/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/df308%2Fx9/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/df308","download_url":"https://codeload.github.com/df308/x9/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229308920,"owners_count":18053032,"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":["high-frequency-trading","high-performance-computing","low-latency","ultra-low-latency"],"created_at":"2024-08-19T19:00:39.116Z","updated_at":"2024-12-11T23:30:25.252Z","avatar_url":"https://github.com/df308.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"X9\n---\n\n*Note: I am currently working on v2.0 which will bring further performance \ngains and flexibility to the user at the (unfortunate) cost of breaking the \ncurrent API. I expect to release v2.0 by September/October 2024 and for it to be the \nlast major/API-breaking change to X9.*\n\nX9 is a low level high performance message passing library, based on a\nlock-free ring buffer implemented with atomic variables, for low latency\nmultithreading work.  \nIt allows for multiple producers/consumers to concurrently access the same\nunderlying ring buffer and provides both spinning (busy loop) and non-blocking\nread and write functions.\n\nThe library is based on three concepts:\n\n- A message, which is a user defined struct.\n- A `x9_inbox`, which is where messages are both written to and read from.\n- A `x9_node`, which is an abstraction that unifies x9_inbox(es).\n\nThe library provides multiple functions to both read from and write to a\n`x9_inbox`, as the right choice depends on the user needs.  \nRefer to _x9.h_, where all public functions are properly documented and their\nuse cases explained, and the examples folder for comprehensive examples of\ndifferent architectures.\n\nEnabling `X9_DEBUG` at compile time will print to stdout the reason why the\nfunctions `x9_inbox_is_valid` and `x9_node_is_valid` returned 'false' (if they\nindeed returned 'false'), or why `x9_select_inbox_from_node` did not return a\nvalid `x9_inbox`.\n\nTo use the library just link with x9.c and include x9.h where necessary.\n\nX9 is as generic, performant and intuitive as C allows, without forcing the\nuser to any sort of build system preprocessor hell, pseudo-C macro based\nlibrary, or worse.  \nIt was originally written in the context of an high-frequency-trading system\nthat this author developed, and was made public in June of 2023.  \nIt is released under the BSD-2-Clause license, with the purpose of serving\nothers and other programs.  \n\nBenchmarks\n---\n\n- Single producer and single consumer transmitting 100M messages via a single \n`x9_inbox`.  \n- Run on Intel 11900k (cpu and ram untuned).  \n- _Msg size_ expressed in bytes, and _Inbox size_ in number of slots in the \nring buffer.   \n- _(See /profiling for how to run your own tests)_  \n\n```\nInbox size | Msg size | Time (secs) | Msgs/second\n-------------------------------------------------\n      1024 |       16 |        4.00 |      25.01M\n      1024 |       32 |        4.03 |      24.82M\n      1024 |       64 |        4.17 |      23.99M\n-------------------------------------------------\n      2048 |       16 |        3.90 |      25.63M\n      2048 |       32 |        3.96 |      25.26M\n      2048 |       64 |        4.09 |      24.43M\n-------------------------------------------------\n      4096 |       16 |        3.86 |      25.88M\n      4096 |       32 |        3.92 |      25.50M\n      4096 |       64 |        4.05 |      24.67M\n-------------------------------------------------\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdf308%2Fx9","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdf308%2Fx9","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdf308%2Fx9/lists"}