Skip to content

Commit 9a76de9

Browse files
committed
chore: add info on how to get gradlew to work
After removing `gradle-wrapper.jar` from being tracked in the repo you need to regenerate it manually when you clone the repo. To do that, you need `gradle` actually installed and then to run `gradle wrapper` in the correct directory. This was added to the README and to the benchmarks' `just init`. Additionally updated the root Justfile to also perform that during `init`.
1 parent 82829bb commit 9a76de9

File tree

4 files changed

+18
-56
lines changed

4 files changed

+18
-56
lines changed

Justfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ default: (build-all "release")
66
# === INIT ===
77

88
# Initialize the repository for development.
9-
init: check-cargo hooks-init checkout-benchmarks
9+
init: check-cargo hooks-init checkout-submodules
1010

1111
# Check if cargo is installed and install it from rustup if not.
1212
[private]
@@ -28,10 +28,15 @@ init: check-cargo hooks-init checkout-benchmarks
2828

2929
# Checkout and populate the benchmarks repository, excluding datasets.
3030
[private]
31-
checkout-benchmarks:
31+
@checkout-submodules:
3232
git submodule init
3333
git submodule update
3434

35+
# Initialize the benchmarks crate.
36+
[private]
37+
@init-benchmarks:
38+
cd crates/rsonpath-benchmarks && just init
39+
3540
# === BUILD ===
3641

3742
alias b := build-bin
@@ -247,7 +252,7 @@ hook-pre-commit:
247252
(just verify-fmt && just verify-check);
248253

249254
[private]
250-
@hook-post-checkout: checkout-benchmarks
255+
@hook-post-checkout: checkout-submodules
251256

252257
[private]
253258
assert-benchmarks-committed:

crates/rsonpath-benchmarks/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ libc = "0.2.168"
3333
lazy_static = "1.5.0"
3434
serde_json = "1.0.134"
3535
sha2 = "0.10.8"
36-
ouroboros = "0.18.4"
3736
reqwest = { version = "0.12.9", features = ["blocking"] }
3837
rsonpath-lib = { version = "0.9.1", default-features = false }
3938
rsonpath-syntax = { version = "0.3.1", default-features = false }

crates/rsonpath-benchmarks/Justfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[private]
22
default: build-bench
33

4+
init:
5+
cd ./src/implementations/jsurferShim && gradle wrapper
6+
47
# === BUILD ===
58

69
alias b := build-bench

crates/rsonpath-benchmarks/README.md

Lines changed: 7 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -12,60 +12,21 @@ Benchmark suite for [`rsonpath`](https://github.com/v0ldek/rsonpath).
1212

1313
## Prerequisites
1414

15-
By default, the benches are performed against a released version of `rsonpath`.
16-
Usually you might want to run it against the local version to test your changes.
17-
To do that, pass a [patch config value] to `cargo`:
15+
By default, the benches are performed against the local version of `rsonpath` in the local repository.
1816

19-
```ini
20-
--config 'patch.crates-io.rsonpath.path = "../rsonpath"'
21-
```
22-
23-
Additionally:
24-
25-
1. An appropriate C++ compiler is required for the [`cc` crate](https://lib.rs/crates/cc) to compile the
26-
JSONSki code.
27-
2. JDK of version at least 8 is required and your `JAVA_HOME` environment variable must be set
17+
1. JDK of version at least 8 is required and your `JAVA_HOME` environment variable must be set
2818
to its location.
19+
2. You need `gradle` to create the required wrapper JAR to build JSurfer. To install `gradle` it's recommended to use
20+
[`SDKMan`](https://sdkman.io/): `sdk install gradle 7.5`. After that is done, run `just init` in the root of `rsonpath-benchmarks`.
21+
This needs to be done only once.
2922

3023
On x86_64 Ubuntu the latters can be done by installing `openjdk-17-jdk` and exporting `JAVA_HOME` as
3124
`/usr/lib/jvm/java-1.17.0-openjdk-amd64`.
3225

3326
### Download the dataset
3427

35-
On a UNIX system with `wget` installed run the script `sh dl.sh`.
36-
You can also manually download the dataset and put the JSON files in the correct folder.
37-
38-
For more information, refers to:
39-
40-
* AST: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7229269.svg)](https://doi.org/10.5281/zenodo.7229269)
41-
* Twitter: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7229287.svg)](https://doi.org/10.5281/zenodo.7229287)
42-
* Crossref: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7229287.svg)](https://doi.org/10.5281/zenodo.7231920)
43-
44-
For the benchmark to work, the directory layout should be as follows:
45-
46-
```ini
47-
── data
48-
   ├── ast
49-
   │   └── ast.json
50-
   ├── crossref
51-
   │   ├── crossref0.json
52-
   │   ├── crossref16.json
53-
   │   ├── crossref1.json
54-
   │   ├── crossref2.json
55-
   │   ├── crossref4.json
56-
   │   └── crossref8.json
57-
   └── twitter
58-
   └── twitter.json
59-
```
60-
61-
The sha256sum of the JSON files, for reference:
62-
63-
* `c3ff840d153953ee08c1d9622b20f8c1dc367ae2abcb9c85d44100c6209571af ast/ast.json`
64-
* `f76da4fbd5c18889012ab9bbc222cc439b4b28f458193d297666f56fc69ec500 crossref/crossref/crossref1.json`
65-
* `95e0038e46ce2e94a0f9dde35ec7975280194220878f83436e320881ccd252b4 crossref/crossref/crossref2.json`
66-
* `f14e65d4f8df3c9144748191c1e9d46a030067af86d0cc03cc67f22149143c5d twitter/twitter.json`
67-
68-
TODO: checksums of other crossrefs
28+
Datasets are automatically downloaded on demand when an appropriate benchmark is ran. The datasets are also
29+
automatically checked against their known SHA256 checksum to verify integrity.
6930

7031
## Usage
7132

@@ -83,12 +44,6 @@ cargo bench --bench <dataset> --no-default-features
8344

8445
The folder `target/criterion` contains all the information needed to plot the experiment.
8546

86-
As a reminder, to test against local changes instead of a crates.io version:
87-
88-
```bash
89-
cargo bench --bench <dataset> --config 'patch.crates-io.rsonpath.path = "../rsonpath"'
90-
```
91-
9247
## Plotting
9348

9449
To plot the result once the is bench done:

0 commit comments

Comments
 (0)