Skip to content

Commit ac85aee

Browse files
authored
Merge pull request #549 from rsonquery/v0ldek/integrate-benchmarks
move rsonpath-benchmarks as a full subdirectory
2 parents fa5d8b4 + d1a279e commit ac85aee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+5211
-11
lines changed

.github/dependabot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ updates:
4343
- minor
4444

4545
- package-ecosystem: cargo
46-
directory: /crates/rsonpath-test
46+
directory: /crates/rsonpath-benchmarks
4747
schedule:
4848
interval: weekly
4949
day: monday

.github/workflows/benchmarks.yml

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: Benchmarks
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
CARGO_PATCH_CRATES_IO_RSONPATH_LIB_GIT: https://github.com/V0ldek/rsonpath.git
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Force remove rsonpath-lib patch from Cargo.toml
19+
run: sed -i '/^\[patch.crates-io\]/d' ./Cargo.toml && sed -i '/^rsonpath-lib = { path = .*$/d' ./Cargo.toml
20+
- name: Install lld
21+
run: sudo apt install lld
22+
- uses: actions/[email protected]
23+
name: Setup Java JDK
24+
with:
25+
distribution: temurin
26+
java-version: 17
27+
- name: Cache restore
28+
id: cache-restore
29+
uses: actions/cache@v3
30+
with:
31+
path: |
32+
~/.cargo/bin/
33+
~/.cargo/registry/index/
34+
~/.cargo/registry/cache/
35+
~/.cargo/git/db/
36+
target/
37+
key: cargo-${{ hashFiles('**/Cargo.toml') }}
38+
- name: Build all features
39+
uses: actions-rs/cargo@v1
40+
with:
41+
command: build
42+
args: --all-features
43+
44+
clippy:
45+
permissions:
46+
checks: write
47+
name: Clippy (stable)
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v3
51+
- name: Force remove rsonpath-lib patch from Cargo.toml
52+
run: sed -i '/^\[patch.crates-io\]/d' ./Cargo.toml && sed -i '/^rsonpath-lib = { path = .*$/d' ./Cargo.toml
53+
- name: Install lld
54+
run: sudo apt install lld
55+
- uses: actions/[email protected]
56+
name: Setup Java JDK
57+
with:
58+
distribution: temurin
59+
java-version: 17
60+
- name: Cache restore
61+
id: cache-restore
62+
uses: actions/cache@v3
63+
with:
64+
path: |
65+
~/.cargo/bin/
66+
~/.cargo/registry/index/
67+
~/.cargo/registry/cache/
68+
~/.cargo/git/db/
69+
target/
70+
key: cargo-${{ hashFiles('**/Cargo.toml') }}
71+
- name: Build all features
72+
uses: actions-rs/cargo@v1
73+
with:
74+
command: build
75+
args: --all-features
76+
env:
77+
RUSTFLAGS: "--deny warnings"
78+
- name: Clippy all features
79+
uses: actions-rs/clippy-check@v1
80+
with:
81+
token: ${{ secrets.GITHUB_TOKEN }}
82+
args: --all-features -- --deny warnings
83+
84+
clippy-nightly:
85+
permissions:
86+
checks: write
87+
name: Clippy (nightly)
88+
runs-on: ubuntu-latest
89+
steps:
90+
- uses: actions/checkout@v3
91+
- name: Force remove rsonpath-lib patch from Cargo.toml
92+
run: sed -i '/^\[patch.crates-io\]/d' ./Cargo.toml && sed -i '/^rsonpath-lib = { path = .*$/d' ./Cargo.toml
93+
- name: Install lld
94+
run: sudo apt install lld
95+
- uses: actions/[email protected]
96+
name: Setup Java JDK
97+
with:
98+
distribution: temurin
99+
java-version: 17
100+
- name: Cache restore
101+
id: cache-restore
102+
uses: actions/cache@v3
103+
with:
104+
path: |
105+
~/.cargo/bin/
106+
~/.cargo/registry/index/
107+
~/.cargo/registry/cache/
108+
~/.cargo/git/db/
109+
target/
110+
key: cargo-${{ hashFiles('**/Cargo.toml') }}
111+
- name: Rustup nightly toolchain
112+
uses: actions-rs/toolchain@v1
113+
with:
114+
toolchain: nightly
115+
components: clippy, rustfmt
116+
override: true
117+
default: true
118+
- name: Build all features
119+
uses: actions-rs/cargo@v1
120+
with:
121+
command: build
122+
args: --all-features
123+
env:
124+
RUSTFLAGS: "--deny warnings"
125+
- name: Clippy all features
126+
uses: actions-rs/clippy-check@v1
127+
with:
128+
token: ${{ secrets.GITHUB_TOKEN }}
129+
args: --all-features -- --deny warnings

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
/target/*
2-
/.vscode/*.log
3-
/simd-benchmarks/plot.svg
2+
/.vscode/*.log

.gitmodules

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[submodule "crates/rsonpath-benchmarks"]
2-
path = crates/rsonpath-benchmarks
3-
url = [email protected]:V0ldek/rsonpath-benchmarks.git
41
[submodule "crates/rsonpath-test/jsonpath-compliance-test-suite"]
52
path = crates/rsonpath-test/jsonpath-compliance-test-suite
63
url = https://github.com/jsonpath-standard/jsonpath-compliance-test-suite.git

Justfile

+3-2
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ verify-bench:
194194
verify-clippy: (build-all "release")
195195
cargo +nightly clippy --workspace --no-default-features --release -- --deny warnings
196196
cargo +nightly clippy --workspace --all-features --release -- --deny warnings
197+
cargo +nightly clippy --manifest-path ./crates/rsonpath-benchmarks/Cargo.toml --release -- --deny warnings
197198

198199
# Verify that documentation successfully builds for rsonpath-lib.
199200
verify-doc $RUSTDOCFLAGS="--cfg docsrs -D warnings":
@@ -203,7 +204,7 @@ verify-doc $RUSTDOCFLAGS="--cfg docsrs -D warnings":
203204

204205
# Verify formatting rules are not violated.
205206
verify-fmt:
206-
cargo fmt -- --check
207+
cargo fmt --all --check
207208

208209
# === CLEAN ===
209210

@@ -304,4 +305,4 @@ release-bug-template ver:
304305
let idx = (cat $path | str index-of '# <newest-release=v{{ver}}>');
305306
if ($idx == -1) {
306307
sed -z -i 's/# <newest-release=v[^>]*>/# <newest-release=v{{ver}}>\n - v{{ver}}/' $path;
307-
}
308+
}

crates/rsonpath-benchmarks

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* eol=lf

crates/rsonpath-benchmarks/.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/target
2+
/.vscode/*.log
3+
/data/*
4+
Cargo.lock
5+
!/data/small
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
https://www.contributor-covenant.org/faq. Translations are available at
128+
https://www.contributor-covenant.org/translations.

crates/rsonpath-benchmarks/Cargo.toml

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
[package]
2+
name = "rsonpath-benchmarks"
3+
authors = [
4+
"Mateusz Gienieczko <[email protected]>",
5+
"Charles Paperman <[email protected]>",
6+
]
7+
version = "0.9.1"
8+
edition = "2021"
9+
description = "Benchmark suite for the `rsonpath` project."
10+
readme = "./README.md"
11+
license = "MIT"
12+
keywords = ["rsonpath", "jsonpath", "query", "simd", "benchmark"]
13+
exclude = ["/data"]
14+
categories = ["text-processing", "development-tools"]
15+
repository = "https://github.com/V0ldek/rsonpath-benchmarks"
16+
17+
[[bin]]
18+
path = "src/main.rs"
19+
name = "pathimpl"
20+
21+
[dependencies]
22+
cfg-if = "1.0.0"
23+
clap = { version = "4.5.19", features = ["derive", "wrap_help"] }
24+
color-eyre = { version = "0.6.2", default-features = false }
25+
criterion = "0.5.1"
26+
eyre = "0.6.12"
27+
flate2 = "1.0.34"
28+
hex-literal = "0.4.1"
29+
indicatif = "0.17.8"
30+
jni = { version = "0.21.1", features = ["invocation", "default"] }
31+
jsonpath-rust = "0.7.1"
32+
libc = "0.2.159"
33+
lazy_static = "1.5.0"
34+
serde_json = "1.0.128"
35+
sha2 = "0.10.8"
36+
ouroboros = "0.18.4"
37+
reqwest = { version = "0.12.8", features = ["blocking"] }
38+
rsonpath-lib = { version = "0.9.1", default-features = false }
39+
rsonpath-syntax = { version = "0.3.1", default-features = false }
40+
serde_json_path = "0.6.7"
41+
tar = "0.4.42"
42+
thiserror = "1.0.64"
43+
44+
[patch.crates-io]
45+
rsonpath-lib = { path = "../rsonpath-lib" }
46+
rsonpath-syntax = { path = "../rsonpath-syntax" }
47+
48+
[dev-dependencies]
49+
itertools = "0.13.0"
50+
regex = "1.11.0"
51+
memchr = "2.7.4"
52+
53+
[features]
54+
default = ["simd"]
55+
simd = ["rsonpath-lib/simd"]
56+
57+
[build-dependencies]
58+
eyre = "0.6.12"
59+
60+
[profile.dev]
61+
lto = false
62+
63+
[profile.release]
64+
lto = "thin"
65+
debug = 1
66+
67+
[[bench]]
68+
name = "main"
69+
harness = false
70+
71+
[[bench]]
72+
name = "main_micro"
73+
harness = false
74+
75+
[[bench]]
76+
name = "rsonpath_query_compilation"
77+
harness = false
78+
79+
[[bench]]
80+
name = "rust_native"
81+
harness = false

0 commit comments

Comments
 (0)