Zaino and Ztreamer are two indexers that serve the lightwallet gRPC protocol, the API that Zcash light wallets use to sync. This page summarises an independent, reproducible comparison of the two: whether they return the same answers, how long they take to build their index, and how fast they serve wallets.
TCP_NODELAY), which adds about 40 ms to many requests. It is a one-line fix.| Build | Backing node | Why |
|---|---|---|
| Zaino 0.10.1 | Zebra 6.4.2 (direct backend) | Latest stable Zaino release |
| Zaino 0.9.0 | Zebra 6.4.2 (direct backend) | The version measured in Ztreamer's own published comparison |
| Ztreamer v0.1.0 | Embedded Zakura node | Latest Ztreamer tag |
| Ztreamer master | Embedded Zakura 1.5.1 | What Ztreamer's install instructions build |
The two use different designs:
Medians of three runs:
| Build | Index complete | First answer | Index size on disk |
|---|---|---|---|
| Zaino 0.10.1 | 1,395 s | 6 s | 22.06 GiB |
| Zaino 0.9.0 | 1,211 s | 6 s | 22.06 GiB |
| Ztreamer v0.1.0 | 216 s | 210 s | 1.44 GiB |
| Ztreamer master | 159 s | 158 s | 1.44 GiB |
Zaino is usable almost at once because it forwards requests to Zebra while it builds. Ztreamer serves nothing until its index is complete. On the same CPU model, Zaino 0.10.1 took 6–6.5× as long as Ztreamer v0.1.0 and used 7.5–8× the CPU time (Zebra included).
Medians of three runs, in blocks per second unless noted:
| Scenario | Zaino 0.10.1 | Ztreamer v0.1.0 |
|---|---|---|
| Block range of 1,000 blocks | 11,414 | 179,486 |
| Full wallet download (280,000 → tip) | 11,124 | 189,041 |
| Block range of 1,000 blocks, 128 clients | 110,093 | 229,527 |
| Single block, 128 clients (requests/s) | 6,843 | 11,044 |
With 128 clients the gap narrows to about 2×, because both servers were limited to two CPU cores.
On Zaino, six of twelve RPCs have a median latency of about 40 ms, and every RPC has a 99th percentile around 41 ms. The cause is the way Zaino sets up its gRPC listener: the TCP_NODELAY socket option is never turned on, so the operating system holds back small responses for up to 40 ms.
Turning the option on from outside, without changing the Zaino binary, removed the floor. For example, GetTreeState dropped from 40.3 ms to 0.75 ms (Ztreamer: 0.63 ms). Bulk block streaming did not change, so the throughput gap above is real.
GetBlock by default, where the protocol says the default is shielded data only. This is fixed in 0.10.1.GetSubtreeRoots: the completingBlockHash field uses opposite byte orders on the two indexers. Current wallets do not read this field.INTERNAL for bad input; Ztreamer returns INVALID_ARGUMENT or NOT_FOUND.GetTaddressBalanceStream are counted twice, except on Ztreamer master.getrawtransaction with verbosity 0 returns an object instead of a hex string, unlike Zebra and zcashd.