surrealpatch/lib/benches
Emmanuel Keller 0a4801dcf8
[Feat] HNSW persistence (#4214)
Co-authored-by: David Bottiau <david.bottiau@outlook.com>
Co-authored-by: Micha de Vries <micha@devrie.sh>
Co-authored-by: Micha de Vries <mt.dev@hotmail.com>
Co-authored-by: Tobie Morgan Hitchcock <tobie@surrealdb.com>
Co-authored-by: ekgns33 <76658405+ekgns33@users.noreply.github.com>
Co-authored-by: Sergii Glushchenko <sergii.glushchenko@surrealdb.com>
Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2024-08-20 11:42:58 +01:00
..
sdb_benches Refactor transaction, caching, and key-value store interfaces (#4257) 2024-07-17 22:44:05 +00:00
executor.rs Add live query API (#2919) 2023-11-13 17:19:47 +00:00
hash_trie_btree.rs MTree/HNSW tests/benches work (#4387) 2024-07-20 08:27:14 +00:00
hashset_vs_vector.rs [Feat] HNSW persistence (#4214) 2024-08-20 11:42:58 +01:00
index_btree.rs Refactor transaction, caching, and key-value store interfaces (#4257) 2024-07-17 22:44:05 +00:00
index_hnsw.rs [Feat] HNSW persistence (#4214) 2024-08-20 11:42:58 +01:00
index_mtree.rs [Feat] HNSW persistence (#4214) 2024-08-20 11:42:58 +01:00
move_vs_clone.rs Feature: Initial Hnsw implementation (#3353) 2024-05-08 14:26:41 +00:00
parser.rs Extract core lib into a standalone crate (#3423) 2024-02-02 22:10:47 +00:00
processor.rs Factor out the parser into its own module. (#2979) 2023-11-18 13:56:13 +00:00
README.md Refactor transaction, caching, and key-value store interfaces (#4257) 2024-07-17 22:44:05 +00:00
sdb.rs [bench] New benchmarks against different datastores (#2956) 2023-11-18 13:55:01 +00:00

Benchmarks

This directory contains some micro-benchmarks that can help objectively establish the performance implications of a change, and also benchmarks that test the performance of different datastores using both the library and the SDK

Manual usage

Common

Execute the following command at the top level of the repository:

$ cargo make bench

Specific datastore

Execute the following commands at the top level of the repository:

  • Memory datastore using the lib or the SDK
$ cargo make bench-lib-mem
$ cargo make bench-sdk-mem
  • RocksDB datastore using the lib or the SDK
$ cargo make bench-lib-rocksdb
$ cargo make bench-sdk-rocksdb
  • WebSocket remote server using the SDK
    • Start SurrealDB server
    $ cargo make build
    $ ./target/release/surreal start
    
    • Run the benchmarks
    $ cargo make bench-sdk-ws
    

Profiling

Some of the benchmarks support CPU profiling:

cargo make bench --profile-time=5

Once complete, check the target/criterion/**/profile/flamegraph.svg files.