diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 0000000..42a701c --- /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 tidy + + - 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 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 +)