2 ms·
Go code communicate with Rust code through network. So there is no overhead. Go has interface, which could be used for expressing the AST, plan tree. We define
by shenli3514 10y ago
Go code communicate with Rust code through network. So there is no overhead.
Go has interface, which could be used for expressing the AST, plan tree. We define some interface for AST node and plan tree node. It is convenient to apply some rules (predict-pushdown/column-pruning/cost-computing) on the tree.
You could refer to the code in https://github.com/pingcap/tidb/blob/master/plan/plan.go https://github.com/pingcap/tidb/blob/master/plan/plan.go
- biokoda 10y ago> So there is no overhead. Other than going through the kernel to talk to a library..
- shenli3514 10y agoWe use RocksDB as the single-machine storage engine and build TiKV above RocksDB as a distributed storage engine. At first we consider use Go to build TiKV, but the cgo overhead between TiKV and Rocksdb is considerable. So we turn to Rust. The network communication overhead between TiDB and TiKV has nothing to do with cgo.