surrealpatch/lib/benches
Mees Delzenne 2755f572fc
Introduce new experimental parser (#2885)
Co-authored-by: Raphael Darley <raphael@raphaeldarley.com>
2024-01-10 16:43:56 +00:00
..
sdb_benches Fix clippy warnings in tests (#3101) 2023-12-09 20:25:50 +00:00
executor.rs Add live query API (#2919) 2023-11-13 17:19:47 +00:00
index_btree.rs Feat: In Memory index store (#3020) 2023-12-13 13:37:24 +00:00
index_mtree.rs Feat: In Memory index store (#3020) 2023-12-13 13:37:24 +00:00
move_vs_clone.rs Factor out the parser into its own module. (#2979) 2023-11-18 13:56:13 +00:00
parser.rs Introduce new experimental parser (#2885) 2024-01-10 16:43:56 +00:00
processor.rs Factor out the parser into its own module. (#2979) 2023-11-18 13:56:13 +00:00
README.md [bench] New benchmarks against different datastores (#2956) 2023-11-18 13:55:01 +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
  • FoundationDB datastore using the lib or the SDK

    • Start FoundationDB
    $ docker run -ti -e FDB_NETWORKING_MODE=host --net=host foundationdb/foundationdb:7.1.30
    
    • Run the benchmarks
    $ 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.