From d602767c53dcb8d0f827a27d4cc7a58aedcea758 Mon Sep 17 00:00:00 2001 From: Alex Gaetano Padula Date: Sun, 15 Jun 2025 07:14:59 -0400 Subject: [PATCH 1/5] addition of github workflow for benchmark tool --- .github/workflows/benchmark.yml | 57 +++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/benchmark.yml diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 0000000..d0d9892 --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -0,0 +1,57 @@ +name: Wildcat Benchmark + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + workflow_dispatch: + +jobs: + benchmark: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.24' + + - name: Cache Go modules + uses: actions/cache@v3 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: Download deps + run: go mod download + + - name: Build bench tool + run: go build -o bench main.go + + - name: Run fast bench + run: | + ./bench \ + -num=1000 \ + -threads=2 \ + -key_size=16 \ + -value_size=100 \ + -benchmarks="fillseq,readseq,readrandom" \ + -cleanup=true \ + -stats=false + + - name: Run concurrent bench + run: | + ./bench \ + -num=500 \ + -threads=4 \ + -benchmarks="concurrent_writers,high_contention_writes" \ + -cleanup=true \ + -stats=false \ No newline at end of file From a83d0499bffe9589a6d1a407071bd18844c8e71e Mon Sep 17 00:00:00 2001 From: Alex Gaetano Padula Date: Sun, 15 Jun 2025 07:16:12 -0400 Subject: [PATCH 2/5] go get to correct no mod to download exception --- .github/workflows/benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index d0d9892..aec1294 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -31,7 +31,7 @@ jobs: ${{ runner.os }}-go- - name: Download deps - run: go mod download + run: go get . - name: Build bench tool run: go build -o bench main.go From 7672372b97a450b465ab09f44f07d21422dbdf61 Mon Sep 17 00:00:00 2001 From: Alex Gaetano Padula Date: Sun, 15 Jun 2025 07:17:53 -0400 Subject: [PATCH 3/5] lets try go mod tidy instead for 'download deps' --- .github/workflows/benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index aec1294..42a701c 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -31,7 +31,7 @@ jobs: ${{ runner.os }}-go- - name: Download deps - run: go get . + run: go mod tidy - name: Build bench tool run: go build -o bench main.go From 7dcec7914ad468b306b7452a36f6988e4c3c74fc Mon Sep 17 00:00:00 2001 From: Alex Gaetano Padula Date: Sun, 15 Jun 2025 07:22:18 -0400 Subject: [PATCH 4/5] remove cache mods section in yml --- .github/workflows/benchmark.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 42a701c..7a83bbb 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -20,16 +20,6 @@ jobs: with: go-version: '1.24' - - name: Cache Go modules - uses: actions/cache@v3 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Download deps run: go mod tidy From bbae7fa758594bad3787d621702ff49b7bbd3dd9 Mon Sep 17 00:00:00 2001 From: Alex Gaetano Padula Date: Sun, 15 Jun 2025 07:25:54 -0400 Subject: [PATCH 5/5] silly be i did not see i had .mod in the gitignore, I can't remember what template I used off github but .mod file was on it. I've removed that. --- .github/workflows/benchmark.yml | 10 ++++++++++ .gitignore | 1 - go.mod | 10 ++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 go.mod diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 7a83bbb..42a701c 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -20,6 +20,16 @@ jobs: with: go-version: '1.24' + - name: Cache Go modules + uses: actions/cache@v3 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Download deps run: go mod tidy diff --git a/.gitignore b/.gitignore index 9dc7734..951a910 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,6 @@ *.su *.idb *.pdb -*.mod* *.cmd .tmp_versions/ modules.order diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..ed9f8e2 --- /dev/null +++ b/go.mod @@ -0,0 +1,10 @@ +module bench + +go 1.24 + +require github.com/wildcatdb/wildcat/v2 v2.2.3 + +require ( + go.mongodb.org/mongo-driver v1.17.3 // indirect + golang.org/x/sys v0.33.0 // indirect +)