Skip to content

Development

Hieu Pham edited this page Feb 9, 2025 · 22 revisions

Dependencies

Most of the dependencies are fetched through Cargo, so it's automatically handled. There are a few manual dependencies you'll need such as HDF5 and protobuf. You can probably use the dependencies shipped with your system/distro.

Libraries

  • On Linux
sudo pacman -Syu hdf5 protobuf openblas
  • On Mac
brew install hdf5 protobuf openblas

Etcd

Etcd is used to manage cluster information for MuopDB

  • On Linux
sudo pacman -Syu yamllint go
  • On Mac (TBD - you probably can just install through homebrew)
  • Compile
# Checkout etcd directory
git clone https://github.com/etcd-io/etcd.git
cd etcd
make build -j 10

# Run etcd
./bin/etcd

Build

Then, go back to your muopdb checkout and try building it

cargo build --release

Benchmark

We will use criterion crate for benchmarking. Guide here. Use cargo bench to run our benchmarks.

Profile

We will use cargo flamegraph for our benchmark. You can do something like:

cargo flamegraph --package <package_name> --unit-test -- <test_name>

For example,

cargo flamegraph --package index --unit-test -- pq::tests::test_product_quantizer_simd

Run index_server locally

Check Quick Start Guide to create a collection and insert some documents to it.