Skip to content

Commit cfd0c63

Browse files
authored
Merge pull request #8 from linksplatform/add_rust_benchmark
Add rust benchmark
2 parents a825cfd + a65ed1a commit cfd0c63

32 files changed

+2579
-1619
lines changed

.github/workflows/rust.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
name: Benchmark Rust version
22

3-
on:
4-
push:
5-
branches:
6-
- add_rust_benchmark
3+
on: [push, pull_request]
74

85
env:
96
toolchain: nightly-2022-08-22
7+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108

119
jobs:
1210
benchmark:
@@ -47,13 +45,23 @@ jobs:
4745
run: cargo bench --bench bench -- --output-format bencher | tee out.txt
4846
- name: Prepare benchmark results
4947
run: |
48+
git config --global user.email "[email protected]"
49+
git config --global user.name "LinksPlatformBencher"
5050
cd rust
5151
pip install numpy matplotlib
5252
python3 out.py
53+
cd ..
54+
git fetch
55+
git checkout gh-pages
56+
mv -f rust/bench_rust.png Docs
57+
mv -f rust/bench_rust_log_scale.png Docs
58+
git add Docs
59+
git commit -m "Publish new benchmark results"
60+
git push origin gh-pages
5361
- name: Save benchmark results
5462
uses: actions/upload-artifact@v3
5563
with:
5664
name: Benchmark results
5765
path: |
58-
rust/Bench1.png
59-
rust/Bench2.png
66+
rust/bench_rust.png
67+
rust/bench_rust_log_scale.png

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
11
# Comparisons.PostgreSQLVSDoublets
22

3-
The comparison between PostgreSQL and Doublets
3+
The comparison between PostgreSQL and LinksPlatform's Doublets (links) on basic database operations with objects (create table, read table, delete table, update table).
4+
All benchmarks ran with 3000 links in background and 1000 in active use (i.e. insert, delete, update).
5+
6+
## Operations
7+
- **Update** – basic update operation
8+
- **Each All** – take all links matching `[*, *, *]` constraint
9+
- **Each Incoming** – take all links matching `[*, *, target]` constraint
10+
- **Each Outgoing** – take all links matching `[*, source, *]` constraint
11+
- **Each Concrete** – take all links matching `[*, source, target]` constraint
12+
- **Each Identity** – take all links matching `[id, *, *]` constraint
13+
- **Delete** – basic delete operation
14+
- **Create** – insert point (link with id = source = target)
15+
16+
## Results
17+
The results below represent the amount of time (ns) the operation takes per iteration.
18+
- First picture shows time in a pixel scale.
19+
- Second picture shows time in a logarithmic scale.
20+
21+
### Rust
22+
![Image of Rust benchmark (pixel scale)](https://github.com/linksplatform/Comparisons.PostgreSQLVSDoublets/blob/gh-pages/Docs/bench_rust.png?raw=true)
23+
![Image of Rust benchmark (log scale)](https://github.com/linksplatform/Comparisons.PostgreSQLVSDoublets/blob/gh-pages/Docs/bench_rust_log_scale.png?raw=true)
24+
25+
## Conclusion
26+
As we can see in this comparison, Doublets are blazingly faster than PostgreSQL in basic database operations.

rust-toolchain.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[toolchain]
2+
channel = "nightly-2022-08-22"

0 commit comments

Comments
 (0)