[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-79002":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":13,"stars7d":13,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":17,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":22,"topics":23,"createdAt":9,"pushedAt":9,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":15,"starSnapshotCount":15,"syncStatus":13,"lastSyncTime":27,"discoverSource":28},79002,"silk","ClickHouse\u002Fsilk","ClickHouse","Fast stackful fibers with a NUMA-aware work-stealing scheduler",null,"C++",213,3,2,1,0,44,6,51.21,"Other",false,"main",true,[],"2026-06-12 04:01:24","# Silk\n\nA cooperative fiber scheduler for Linux with per-CPU scheduler threads, io_uring integration, and topology-aware work-stealing. Fibers are lightweight stackful coroutines that suspend rather than block their OS thread, enabling high concurrency with low overhead.\n\n## Documentation\n\n- [`docs\u002Fscheduler.md`](docs\u002Fscheduler.md) — scheduler loop, context switching, suspension pattern, async IO, sleep cancellation, work-stealing design, and performance benchmarks\n- [`docs\u002Fsync.md`](docs\u002Fsync.md) — synchronization primitives: `FiberFuture`, `FiberFutex`, `FiberMutex`, `FiberSequencer`, `FiberEvent`, `FairFiberMutex`\n- [`docs\u002Futil.md`](docs\u002Futil.md) — utility library: lock-free data structures, TSC timing, memory pool, CPU topology, logging, assertions\n- [`docs\u002Fperf.md`](docs\u002Fperf.md) — `net-perf` and `file-perf` benchmark results and fio comparison\n- [`docs\u002Fcoroutines.md`](docs\u002Fcoroutines.md) — stackless coroutines vs stackful fibers: design differences and performance data\n- [`src\u002Ffibers\u002Ftests\u002F`](src\u002Ffibers\u002Ftests\u002F) — usage examples: fiber lifecycle, futures, synchronization primitives, async IO\n- [`src\u002Fgdb\u002Ffiber.py`](src\u002Fgdb\u002Ffiber.py) — GDB extension; load with `source src\u002Fgdb\u002Ffiber.py`, then use `fiber-list`, `fiber-savecontext`, `fiber-restorecontext`, `fiber-switchcontext`\n\n## Requirements\n\n- CMake >= 3.28\n- Ninja\n- Clang 21\n- ccache (optional)\n- Boost headers (`libboost-dev`)\n- libelf (`libelf-dev`) — optional, required only for `src\u002Fprofiler`; the profiler is silently skipped if absent.\n\nGTest, Google Benchmark, libbacktrace, liburing, librseq, libbpf, bpftool, and cxxopts are bundled as submodules under `contrib\u002F` and do not need to be installed separately. The two Boost.Context asm sources used for fiber switching are vendored under `contrib\u002Ffcontext\u002F`, and systemtap's USDT headers (`\u003Csys\u002Fsdt.h>` + `\u003Csys\u002Fsdt-config.h>`) under `contrib\u002Fsystemtap-sdt\u002F` (both vendored directly, no submodule). Poco, the AWS SDK, and jemalloc are built on demand via `--build-poco`, `--build-aws`, and `--build-jemalloc` passed to `configure`.\n\nRuntime dependencies for optional benchmarks: nginx (only for `http-perf --nginx`; the default uses an internal Poco-based server built into the `http-perf` binary), fio (for `fio-perf`), and MinIO (for `s3-perf`). MinIO is downloaded automatically to `.tools\u002F` if not in PATH; the others must be installed separately.\n\n## Build\n\n```\n.\u002Fbb [options] [command]\n```\n\n### Global options\n\n| Option | Values | Default | Description |\n|---|---|---|---|\n| `-b`, `--build` | `debug`, `release` | `debug` | Build type |\n| `-s`, `--sanitizer` | `thread`, `address`, `memory`, `undefined` | | Enable sanitizer |\n| `-v`, `--verbose` | | | Print every command before running it; also passes `--verbose` to perf binaries to enable their debug logging |\n\n### Commands\n\n#### `configure [--build-poco] [--build-aws] [--build-jemalloc]`\n\nConfigure (or reconfigure) the CMake build directory. Optional flags enable components that are off by default: `--build-poco` enables `http-perf` (requires Poco), `--build-aws` enables `s3-perf` (requires the AWS SDK), `--build-jemalloc` enables jemalloc (used by `http-perf` and `s3-perf` to improve allocator performance).\n\n```\n.\u002Fbb configure\n.\u002Fbb configure --build-poco --build-aws\n.\u002Fbb -b release configure\n```\n\n#### `fmt [--check]`\n\nFormat all source files with clang-format-21. Pass `--check` to verify formatting without modifying files (exits non-zero if any file would be changed).\n\n```\n.\u002Fbb fmt\n.\u002Fbb fmt --check\n```\n\n#### `clean`\n\nRemove the entire `build\u002F` directory.\n\n```\n.\u002Fbb clean\n```\n\n#### `build [targets]`\n\nBuild the project. Configures automatically if the build directory does not exist. `build` is the default command when none is specified.\n\n```\n.\u002Fbb                          # debug build\n.\u002Fbb -b release               # release build\n.\u002Fbb -s thread                # debug build with TSan\n.\u002Fbb -b release -s address    # release build with ASan\n.\u002Fbb build fibers-test        # build a specific target\n```\n\n#### `test [-R pattern] [-N] [ctest flags...]`\n\nBuild and run tests. Runs in parallel using all available CPUs. Any extra flags are forwarded directly to `ctest`.\n\n| Flag | Description |\n|---|---|\n| `-R \u003Cpattern>` | Run only tests matching the regex pattern |\n| `-N` | List tests without running them |\n| `--timeout SECONDS` | Per-test timeout in seconds (default: 180, 0=none) |\n| `--coverage` | Instrument with coverage, run tests, and generate an HTML report, an lcov file, and a Cobertura XML report under `build\u002Fdebug-coverage\u002F` |\n| `--rerun-failed` | Rerun only tests that failed in the last run |\n| `--repeat until-fail:\u003Cn>` | Repeat each test up to `n` times, stopping on first failure (useful for flaky test hunting) |\n| `--output-on-failure` | Print test output when a test fails |\n\n```\n.\u002Fbb test\n.\u002Fbb test -R FiberMutex\n.\u002Fbb -s thread test\n.\u002Fbb test --rerun-failed\n.\u002Fbb test --coverage\n```\n\n#### `bench [-R pattern] [-N] [gbench flags...]`\n\nBuild and run benchmarks.\n\n| Flag | Description |\n|---|---|\n| `-R \u003Cpattern>` | Run only benchmarks matching the pattern |\n| `-N` | List benchmarks without running them |\n| `--timeout SECONDS` | Per-benchmark timeout in seconds (default: 180, 0=none) |\n\n```\n.\u002Fbb -b release bench\n.\u002Fbb -b release bench -R LockFreeQueue\n```\n\n---\n\n## Performance commands\n\nEach perf command builds the relevant binary and runs the benchmark, printing results as a Markdown table. Duration, warmup, and delay options accept a unit suffix (`ns`, `us`, `ms`, `s`, `m`); a bare number is interpreted as seconds. All perf commands accept `--timeout SECONDS` (per-run timeout; default: 180, 0=none).\n\n#### `file-perf`\n\nAsync file I\u002FO benchmark using io_uring.\n\n| Option | Default | Description |\n|---|---|---|\n| `--file PATH` | `\u002Fdev\u002Fshm\u002Ffile-perf.bin` | Test file path |\n| `--bs SIZE` | `4k` | Block size |\n| `--size SIZE` | `1g` | File size |\n| `--duration DURATION` | `10` | Measurement duration |\n| `--warmup DURATION` | `2` | Warmup duration |\n| `--numjobs N [N ...]` | `1` | Number of parallel jobs |\n| `--iodepth N [N ...]` | `16` | IO queue depth per job |\n| `--rw MODE [MODE ...]` | `randread` | Access mode(s): `randread`, `randwrite`, `seqread` |\n| `--flamegraph` | | Profile and generate flamegraph SVG |\n| `--print-counters` | | Print perf counters after each run |\n\n```\n.\u002Fbb -b release file-perf\n.\u002Fbb -b release file-perf --bs 64k --size 4g\n.\u002Fbb -b release file-perf --numjobs 1 16 --iodepth 1 16\n.\u002Fbb -b release file-perf --rw randread randwrite\n.\u002Fbb -b release file-perf --flamegraph\n```\n\n#### `fio-perf`\n\nfio comparison using io_uring engine. Same options as `file-perf` (except `--flamegraph` and `--print-counters`). Does not build anything.\n\n```\n.\u002Fbb fio-perf\n.\u002Fbb fio-perf --bs 64k\n.\u002Fbb fio-perf --numjobs 1 16 --iodepth 1 16\n```\n\n#### `net-perf`\n\nTCP echo benchmark. Starts a local server and runs the client against it. When `--host` points to a remote host, the server is not started locally.\n\n| Option | Default | Description |\n|---|---|---|\n| `--host` | `127.0.0.1` | Server host |\n| `--port` | `17777` | Server port |\n| `--msg-size BYTES` | `64` | Echo message size |\n| `--duration DURATION` | `10` | Measurement duration |\n| `--warmup DURATION` | `2` | Warmup duration |\n| `--connections N [N ...]` | `1000` | Connection counts to sweep |\n| `--delay DURATION` | `0` | Server-side delay per message (e.g. `1ms`, `100us`) |\n| `--flamegraph` | | Profile client and generate flamegraph SVG |\n| `--print-counters` | | Print perf counters after each run |\n\n```\n.\u002Fbb -b release net-perf\n.\u002Fbb -b release net-perf --connections 1 64 256 1024\n.\u002Fbb -b release net-perf --delay 1ms\n.\u002Fbb -b release net-perf --host 10.0.0.2\n.\u002Fbb -b release net-perf --flamegraph\n```\n\n#### `net-perf-asio`\n\nTCP echo benchmark using Boost.Asio C++20 coroutines. Same options as `net-perf`.\n\n```\n.\u002Fbb -b release net-perf-asio\n.\u002Fbb -b release net-perf-asio --connections 1 64 256 1024\n.\u002Fbb -b release net-perf-asio --delay 1ms\n.\u002Fbb -b release net-perf-asio --flamegraph\n```\n\n#### `http-perf`\n\nHTTP\u002F1.1 GET benchmark. Defaults to silk's internal HTTP server (Poco's `HTTPServerConnection` over `FiberSocketImpl`, one fiber per connection); pass `--nginx` to run against nginx instead.\n\n| Option | Default | Description |\n|---|---|---|\n| `--host` | `127.0.0.1` | Server host |\n| `--port` | `18080` | Server port |\n| `--duration DURATION` | `10` | Measurement duration |\n| `--warmup DURATION` | `2` | Warmup duration |\n| `--connections N [N ...]` | `1000` | Connection counts to sweep |\n| `--delay DURATION` | `0` | Server-side per-request delay (e.g. `1ms`, `100us`); fiber server uses `silk::FiberScheduler::sleep`, nginx uses lua sleep |\n| `--threads` | | Use thread-per-connection client mode instead of fibers |\n| `--nginx` | | Run client against nginx instead of the internal server |\n| `--flamegraph` | | Profile client and generate flamegraph SVG |\n| `--print-counters` | | Print perf counters after each run |\n\n```\n.\u002Fbb -b release http-perf\n.\u002Fbb -b release http-perf --threads\n.\u002Fbb -b release http-perf --nginx\n.\u002Fbb -b release http-perf --delay 5ms\n.\u002Fbb -b release http-perf --connections 1 512 1024 2048\n.\u002Fbb -b release http-perf --flamegraph\n```\n\n#### `s3-perf`\n\nS3 object storage benchmark. Starts a local MinIO server (downloaded automatically to `.tools\u002F` if not in PATH) and runs the client against it.\n\n| Option | Default | Description |\n|---|---|---|\n| `--endpoint URL` | `http:\u002F\u002F127.0.0.1:9000` | S3 endpoint |\n| `--bucket NAME` | `test-bucket` | S3 bucket |\n| `--key NAME` | `test-object` | S3 object key |\n| `--region NAME` | `us-east-1` | S3 region |\n| `--access-key KEY` | `minioadmin` | S3 access key |\n| `--secret-key KEY` | `minioadmin` | S3 secret key |\n| `--size SIZE` | `4096` | Object size; no units = bytes (e.g. `4096`, `64k`, `1g`) |\n| `--duration DURATION` | `10` | Measurement duration |\n| `--warmup DURATION` | `2` | Warmup duration |\n| `--numjobs N [N ...]` | `1` | Number of parallel jobs |\n| `--iodepth N [N ...]` | `16` | IO queue depth per job |\n| `--rw MODE [MODE ...]` | `read` | Access mode(s): `read`, `write`, `readwrite` |\n| `--threads` | | Also run with thread executor |\n| `--flamegraph` | | Profile first config and generate flamegraph SVG |\n| `--print-counters` | | Print perf counters after each run |\n| `--data-dir PATH` | `\u002Fdev\u002Fshm\u002Fminio-data` | MinIO data directory |\n\n```\n.\u002Fbb -b release s3-perf\n.\u002Fbb -b release s3-perf --rw read write\n.\u002Fbb -b release s3-perf --numjobs 1 16 --iodepth 1 64\n.\u002Fbb -b release s3-perf --threads\n.\u002Fbb -b release s3-perf --flamegraph\n```\n\n#### `perf`\n\nRun multiple perf benchmarks in one shot. Targets are positional values, listed after the options.\n\n| Target | Description |\n|---|---|\n| `file` | file-perf |\n| `fio` | fio comparison |\n| `net` | net-perf |\n| `net-asio` | net-perf-asio |\n| `net-epoll` | net-perf-epoll |\n| `http` | http-perf (internal server, fiber client) |\n| `http-threads` | http-perf (internal server, thread client) |\n| `http-nginx` | http-perf against nginx (fiber client) |\n| `s3` | s3-perf (fibers) |\n| `s3-threads` | s3-perf (threads) |\n| `all` | run every target above |\n\n| Option | Description |\n|---|---|\n| `--duration DURATION` | Override per-binary measurement duration (e.g. `60s`) |\n| `--warmup DURATION` | Override per-binary warmup duration (e.g. `10s`) |\n| `--timeout SECONDS` | Per-run timeout (default 180, 0 = none) |\n\n```\n.\u002Fbb -b release perf file net\n.\u002Fbb -b release perf all\n.\u002Fbb -b release perf --duration 60s --warmup 10s file net net-asio\n.\u002Fbb -b release perf --duration 60s --warmup 10s all\n```\n","Silk 是一个适用于 Linux 的高性能协作式纤程调度器，它通过每 CPU 调度线程、io_uring 集成以及拓扑感知的工作窃取机制来实现高效的并发处理。项目采用 C++ 编写，其核心功能包括支持轻量级的堆栈纤程（而非阻塞操作系统线程），从而以较低开销达到高并发性。此外，Silk 提供了多种同步原语如 FiberFuture 和 FiberMutex 等，并且内置了对异步 I\u002FO 操作的支持及睡眠取消机制。该项目特别适合于需要在多核处理器环境中高效管理大量并发任务的应用场景，例如网络服务器、数据库系统或任何要求低延迟和高吞吐量的数据密集型服务。","2026-06-11 03:57:22","CREATED_QUERY"]