Performance
Benchmark methodology: CRoaring's census1881 dataset, full client round-trip latency per command against a dockerized Valkey, compared with the equivalent native commands. The benchmark runs in CI whenever performance-relevant code changes and updates the table below automatically.
Reading the table: point operations (SETBIT/GETBIT) are round-trip dominated and land at parity with native commands. The wins appear where native bitmaps do O(N) work on uncompressed bytes: BITCOUNT reads a cached cardinality, and the BITOP family operates on compressed containers — several times faster on this dataset.
| OP | TIME/OP (us) | ST.DEV. (us) |
|---|---|---|
| R.SETBIT | 125.14 | 16.12 |
| R64.SETBIT | 124.62 | 15.30 |
| SETBIT | 123.71 | 14.27 |
| R.GETBIT | 124.04 | 13.60 |
| R64.GETBIT | 124.03 | 13.98 |
| GETBIT | 122.85 | 12.98 |
| R.BITCOUNT | 119.91 | 15.76 |
| R64.BITCOUNT | 115.38 | 11.31 |
| BITCOUNT | 132.52 | 11.49 |
| R.BITPOS | 115.94 | 5.77 |
| R64.BITPOS | 116.69 | 14.65 |
| BITPOS | 122.46 | 10.50 |
| R.BITOP NOT | 276.14 | 568.05 |
| R64.BITOP NOT | 277.00 | 533.02 |
| BITOP NOT | 298.35 | 92.27 |
| R.BITOP AND | 129.78 | 27.38 |
| R64.BITOP AND | 152.80 | 16.89 |
| BITOP AND | 299.21 | 201.50 |
| R.BITOP OR | 156.51 | 38.52 |
| R64.BITOP OR | 155.64 | 38.46 |
| BITOP OR | 401.46 | 321.16 |
| R.BITOP XOR | 151.89 | 40.89 |
| R64.BITOP XOR | 131.65 | 42.77 |
| BITOP XOR | 351.43 | 288.43 |
| R.BITOP ANDOR | 124.72 | 25.41 |
| R64.BITOP ANDOR | 124.06 | 16.60 |
| BITOP ANDOR | 130.56 | 11.50 |
| R.BITOP ONE | 156.45 | 39.87 |
| R64.BITOP ONE | 152.59 | 46.87 |
| BITOP ONE | 138.07 | 5.34 |
| R.MIN | 114.18 | 11.54 |
| R64.MIN | 137.03 | 11.75 |
| MIN | 139.51 | 4.57 |
| R.MAX | 130.37 | 12.03 |
| R64.MAX | 137.09 | 7.48 |
| MAX | 113.39 | 10.12 |
Notes: native MIN/MAX don't exist and BITOP ANDOR/BITOP ONE are not supported by Valkey 8.1, so those native rows measure error-reply round-trips. St.dev. is the per-command standard deviation. Numbers come from shared GitHub Actions runners — ratios between rows are meaningful, absolute latencies fluctuate.