vdaas / vald

Vald. A Highly Scalable Distributed Vector Search Engine
https://vald.vdaas.org
Apache License 2.0
1.51k stars 75 forks source link

[WIP] implement rust embedded kvs benchmark #2523

Closed kmrmt closed 4 weeks ago

kmrmt commented 2 months ago

Description

add benchmark for rust embedded KVS. run benchmark with following command:

$ cargo bench -p kvs

Related Issue

Versions

Checklist

Special notes for your reviewer

coderabbitai[bot] commented 2 months ago

[!IMPORTANT]

Review skipped

Ignore keyword(s) in the title.

Ignored keywords (3) * WIP * DO NOT MERGE * DNM

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configuration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
vdaas-ci commented 2 months ago

[CHATOPS:HELP] ChatOps commands.

cloudflare-pages[bot] commented 2 months ago

Deploying vald with  Cloudflare Pages  Cloudflare Pages

Latest commit: 22996c3
Status: ✅  Deploy successful!
Preview URL: https://82221ac0.vald.pages.dev
Branch Preview URL: https://benchmark-agent-rust-kvs.vald.pages.dev

View logs

kmrmt commented 2 months ago

divan benchmark result

     Running benches/divan_benchmark.rs (target/release/deps/divan_benchmark-c2fdd2ba526e75ab)
Timer precision: 10 ns
divan_benchmark            fastest       │ slowest       │ median        │ mean          │ samples │ iters
├─ bench_get                             │               │               │               │         │
│  ├─ Kv                   240.8 µs      │ 464.7 µs      │ 257.8 µs      │ 266 µs        │ 100     │ 100
│  │                       alloc:        │               │               │               │         │
│  │                         2064        │ 2691          │ 2120          │ 2087          │         │
│  │                         172.2 KB    │ 408.3 KB      │ 189.3 KB      │ 183.8 KB      │         │
│  │                       dealloc:      │               │               │               │         │
│  │                         2112        │ 3617          │ 2080          │ 2096          │         │
│  │                         199.1 KB    │ 1.063 MB      │ 181.5 KB      │ 191.3 KB      │         │
│  │                       grow:         │               │               │               │         │
│  │                         0           │ 54            │ 0             │ 0.54          │         │
│  │                         0 B         │ 127 KB        │ 0 B           │ 1.27 KB       │         │
│  ├─ Persy                7.486 ms      │ 11.63 ms      │ 8.085 ms      │ 8.126 ms      │ 100     │ 100
│  │                       alloc:        │               │               │               │         │
│  │                         25687       │ 25694         │ 25690         │ 25693         │         │
│  │                         9.01 MB     │ 17.53 MB      │ 9.011 MB      │ 9.184 MB      │         │
│  │                       dealloc:      │               │               │               │         │
│  │                         25600       │ 25601         │ 25600         │ 25600         │         │
│  │                         8.977 MB    │ 13.24 MB      │ 8.977 MB      │ 9.066 MB      │         │
│  │                       grow:         │               │               │               │         │
│  │                         0           │ 469           │ 0             │ 400.4         │         │
│  │                         0 B         │ 3.752 KB      │ 0 B           │ 45.14 KB      │         │
│  ├─ Redb                 342.4 µs      │ 398.6 µs      │ 350.6 µs      │ 353.7 µs      │ 100     │ 100
│  │                       alloc:        │               │               │               │         │
│  │                         7168        │ 7168          │ 7168          │ 7168          │         │
│  │                         208.8 KB    │ 208.8 KB      │ 208.8 KB      │ 208.8 KB      │         │
│  │                       dealloc:      │               │               │               │         │
│  │                         7168        │ 7168          │ 7168          │ 7168          │         │
│  │                         208.8 KB    │ 208.8 KB      │ 208.8 KB      │ 208.8 KB      │         │
│  ├─ Rkv                  212.4 µs      │ 260.2 µs      │ 224.1 µs      │ 223.4 µs      │ 100     │ 100
│  │                       alloc:        │               │               │               │         │
│  │                         3072        │ 3072          │ 3072          │ 3072          │         │
│  │                         432.1 KB    │ 432.1 KB      │ 432.1 KB      │ 432.1 KB      │         │
│  │                       dealloc:      │               │               │               │         │
│  │                         3072        │ 3072          │ 3072          │ 3072          │         │
│  │                         432.1 KB    │ 432.1 KB      │ 432.1 KB      │ 432.1 KB      │         │
│  ├─ Rocksdb              231.7 µs      │ 384.4 µs      │ 237.3 µs      │ 242.7 µs      │ 100     │ 100
│  │                       alloc:        │               │               │               │         │
│  │                         1024        │ 1024          │ 1024          │ 1024          │         │
│  │                         131 KB      │ 131 KB        │ 131 KB        │ 131 KB        │         │
│  │                       dealloc:      │               │               │               │         │
│  │                         1024        │ 1024          │ 1024          │ 1024          │         │
│  │                         131 KB      │ 131 KB        │ 131 KB        │ 131 KB        │         │
│  ╰─ Sled                 205.3 µs      │ 398.8 µs      │ 215.7 µs      │ 217.5 µs      │ 100     │ 100
│                          alloc:        │               │               │               │         │
│                            2064        │ 2691          │ 2093          │ 2087          │         │
│                            172.2 KB    │ 408.3 KB      │ 189.4 KB      │ 183.8 KB      │         │
│                          dealloc:      │               │               │               │         │
│                            2048        │ 2574          │ 2112          │ 2085          │         │
│                            163.8 KB    │ 549 KB        │ 199.1 KB      │ 185.9 KB      │         │
│                          grow:         │               │               │               │         │
│                            0           │ 54            │ 0             │ 0.54          │         │
│                            0 B         │ 127 KB        │ 0 B           │ 1.27 KB       │         │
├─ bench_parallel_get_set                │               │               │               │         │
│  ├─ Kv                   353.2 µs      │ 1 ms          │ 901.3 µs      │ 761.3 µs      │ 100     │ 100
│  │                       alloc:        │               │               │               │         │
│  │                         9           │ 9             │ 9             │ 9             │         │
│  │                         384 B       │ 384 B         │ 384 B         │ 384 B         │         │
│  │                       dealloc:      │               │               │               │         │
│  │                         5           │ 5             │ 5             │ 5             │         │
│  │                         288 B       │ 288 B         │ 288 B         │ 288 B         │         │
│  ├─ Persy                841.2 ms      │ 2.676 s       │ 1.997 s       │ 1.713 s       │ 100     │ 100
│  │                       alloc:        │               │               │               │         │
│  │                         9           │ 9             │ 9             │ 9             │         │
│  │                         384 B       │ 384 B         │ 384 B         │ 384 B         │         │
│  │                       dealloc:      │               │               │               │         │
│  │                         5           │ 5             │ 5             │ 5             │         │
│  │                         288 B       │ 288 B         │ 288 B         │ 288 B         │         │
│  ├─ Redb                 1.732 s       │ 2.641 s       │ 1.839 s       │ 1.843 s       │ 100     │ 100
│  │                       alloc:        │               │               │               │         │
│  │                         9           │ 9             │ 9             │ 9             │         │
│  │                         384 B       │ 384 B         │ 384 B         │ 384 B         │         │
│  │                       dealloc:      │               │               │               │         │
│  │                         5           │ 5             │ 5             │ 5             │         │
│  │                         288 B       │ 288 B         │ 288 B         │ 288 B         │         │
│  ├─ Rkv                  369.3 ms      │ 467.1 ms      │ 401.5 ms      │ 402.6 ms      │ 100     │ 100
│  │                       alloc:        │               │               │               │         │
│  │                         9           │ 9             │ 9             │ 9             │         │
│  │                         384 B       │ 384 B         │ 384 B         │ 384 B         │         │
│  │                       dealloc:      │               │               │               │         │
│  │                         5           │ 5             │ 5             │ 5             │         │
│  │                         288 B       │ 288 B         │ 288 B         │ 288 B         │         │
│  ├─ Rocksdb              2.017 ms      │ 7.443 ms      │ 4.739 ms      │ 4.731 ms      │ 100     │ 100
│  │                       alloc:        │               │               │               │         │
│  │                         9           │ 9             │ 9             │ 9             │         │
│  │                         384 B       │ 384 B         │ 384 B         │ 384 B         │         │
│  │                       dealloc:      │               │               │               │         │
│  │                         5           │ 5             │ 5             │ 5             │         │
│  │                         288 B       │ 288 B         │ 288 B         │ 288 B         │         │
│  ╰─ Sled                 394.3 µs      │ 802.8 µs      │ 667.4 µs      │ 660.9 µs      │ 100     │ 100
│                          alloc:        │               │               │               │         │
│                            9           │ 9             │ 9             │ 9             │         │
│                            384 B       │ 384 B         │ 384 B         │ 384 B         │         │
│                          dealloc:      │               │               │               │         │
│                            5           │ 5             │ 5             │ 5             │         │
│                            288 B       │ 288 B         │ 288 B         │ 288 B         │         │
╰─ bench_set                             │               │               │               │         │
   ├─ Kv                   254.7 µs      │ 946.4 µs      │ 267.8 µs      │ 275.8 µs      │ 100     │ 100
   │                       alloc:        │               │               │               │         │
   │                         1040        │ 2930          │ 1055          │ 1077          │         │
   │                         147.7 KB    │ 572.6 KB      │ 156.6 KB      │ 161.3 KB      │         │
   │                       dealloc:      │               │               │               │         │
   │                         1024        │ 1675          │ 1056          │ 1062          │         │
   │                         139.2 KB    │ 478 KB        │ 156.9 KB      │ 160.2 KB      │         │
   │                       grow:         │               │               │               │         │
   │                         0           │ 407           │ 0             │ 4.07          │         │
   │                         0 B         │ 98.75 KB      │ 0 B           │ 987.5 B       │         │
   ├─ Persy                1.908 s       │ 2.906 s       │ 2.035 s       │ 2.057 s       │ 100     │ 100
   │                       alloc:        │               │               │               │         │
   │                         149414      │ 149349        │ 149379        │ 149333        │         │
   │                         62.43 MB    │ 62.4 MB       │ 62.41 MB      │ 62.39 MB      │         │
   │                       dealloc:      │               │               │               │         │
   │                         149410      │ 149351        │ 149379        │ 149332        │         │
   │                         77.57 MB    │ 77.54 MB      │ 77.55 MB      │ 77.53 MB      │         │
   │                       grow:         │               │               │               │         │
   │                         17847       │ 17847         │ 17847         │ 17847         │         │
   │                         15.13 MB    │ 15.13 MB      │ 15.13 MB      │ 15.13 MB      │         │
   ├─ Redb                 1.737 s       │ 2.303 s       │ 1.833 s       │ 1.837 s       │ 100     │ 100
   │                       alloc:        │               │               │               │         │
   │                         37888       │ 37888         │ 37888         │ 37890         │         │
   │                         40.25 MB    │ 40.25 MB      │ 40.25 MB      │ 40.25 MB      │         │
   │                       dealloc:      │               │               │               │         │
   │                         37888       │ 37888         │ 37888         │ 37888         │         │
   │                         48.46 MB    │ 48.46 MB      │ 48.46 MB      │ 48.46 MB      │         │
   │                       grow:         │               │               │               │         │
   │                         9216        │ 9216          │ 9216          │ 9216          │         │
   │                         8.211 MB    │ 8.211 MB      │ 8.211 MB      │ 8.211 MB      │         │
   ├─ Rkv                  359.3 ms      │ 415.3 ms      │ 378.3 ms      │ 380.9 ms      │ 100     │ 100
   │                       alloc:        │               │               │               │         │
   │                         3330048     │ 3330048       │ 3330048       │ 3330048       │         │
   │                         613.7 MB    │ 613.7 MB      │ 613.7 MB      │ 613.7 MB      │         │
   │                       dealloc:      │               │               │               │         │
   │                         3330048     │ 3330048       │ 3330048       │ 3330048       │         │
   │                         613.7 MB    │ 613.7 MB      │ 613.7 MB      │ 613.7 MB      │         │
   │                       grow:         │               │               │               │         │
   │                         1024        │ 1024          │ 1024          │ 1024          │         │
   │                         18.43 KB    │ 18.43 KB      │ 18.43 KB      │ 18.43 KB      │         │
   ├─ Rocksdb              1.881 ms      │ 2.16 ms       │ 2.047 ms      │ 2.028 ms      │ 100     │ 100
   ╰─ Sled                 191.9 µs      │ 701.8 µs      │ 205.1 µs      │ 210.7 µs      │ 100     │ 100
                           alloc:        │               │               │               │         │
                             1042        │ 2930          │ 1040          │ 1077          │         │
                             148.7 KB    │ 572.6 KB      │ 148.7 KB      │ 161.3 KB      │         │
                           dealloc:      │               │               │               │         │
                             1024        │ 1530          │ 1024          │ 1061          │         │
                             139.2 KB    │ 402 KB        │ 139.2 KB      │ 159.4 KB      │         │
                           grow:         │               │               │               │         │
                             0           │ 407           │ 0             │ 4.07          │         │
                             0 B         │ 98.75 KB      │ 0 B           │ 987.5 B       │         │

     Running benches/kvs_impl.rs (target/release/deps/kvs_impl-54163c3f748f7621)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s