surrealpatch/sdk/benches
Maxwell Flitton 0a1a99dc68
Initial commit for SurrealCS (#4458)
Co-authored-by: Tobie Morgan Hitchcock <tobie@surrealdb.com>
Co-authored-by: Raphael Darley <raphael.darley@surrealdb.com>
2024-09-04 14:53:37 +01:00
..
sdb_benches Initial commit for SurrealCS (#4458) 2024-09-04 14:53:37 +01:00
executor.rs Rename lib to sdk (#4561) 2024-08-22 10:26:03 +00:00
hash_trie_btree.rs Rename lib to sdk (#4561) 2024-08-22 10:26:03 +00:00
hashset_vs_vector.rs Rename lib to sdk (#4561) 2024-08-22 10:26:03 +00:00
index_btree.rs Rename lib to sdk (#4561) 2024-08-22 10:26:03 +00:00
index_hnsw.rs Rename lib to sdk (#4561) 2024-08-22 10:26:03 +00:00
index_mtree.rs Rename lib to sdk (#4561) 2024-08-22 10:26:03 +00:00
move_vs_clone.rs Rename lib to sdk (#4561) 2024-08-22 10:26:03 +00:00
parser.rs Rename lib to sdk (#4561) 2024-08-22 10:26:03 +00:00
processor.rs Rename lib to sdk (#4561) 2024-08-22 10:26:03 +00:00
README.md Rename lib to sdk (#4561) 2024-08-22 10:26:03 +00:00
sdb.rs Rename lib to sdk (#4561) 2024-08-22 10:26:03 +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.