Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add benchmarks for "insert many" operations #591

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Sep 15, 2024

  1. Add benchmarks for "insert many" operations

    A couple quick benchmarks for the two "insert many" variants to help vet
    whether or not we should keep the "fast" route.
    
    There is definitely a speed difference, with the fast variant being
    about 25% faster as it can skip returning rows:
    
        go test -bench=BenchmarkClient
        goos: darwin
        goarch: arm64
        pkg: github.com/riverqueue/river
        cpu: Apple M1
        BenchmarkClient/JobInsertMany-8                      312           4156647 ns/op
        BenchmarkClient/JobInsertManyFast-8                  417           3054985 ns/op
        PASS
        ok      github.com/riverqueue/river     15.709s
    
    Can't 100% decide where that leaves us. There's definitely a speed
    advantage, but it definitely congests the API to a degree, and having
    more functions make implementing features like middleware trickier.
    brandur committed Sep 15, 2024
    Configuration menu
    Copy the full SHA
    999ff03 View commit details
    Browse the repository at this point in the history