Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/objectbox/objectbox-go-performance
Open Source Performance Benchmarks for ObjectBox Go, GORM, and others
https://github.com/objectbox/objectbox-go-performance
bbolt database golang gorm objectbox orm performance storm
Last synced: 2 days ago
JSON representation
Open Source Performance Benchmarks for ObjectBox Go, GORM, and others
- Host: GitHub
- URL: https://github.com/objectbox/objectbox-go-performance
- Owner: objectbox
- License: apache-2.0
- Created: 2019-07-16T11:45:25.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-06-23T15:05:42.000Z (over 1 year ago)
- Last Synced: 2024-06-21T19:37:35.639Z (5 months ago)
- Topics: bbolt, database, golang, gorm, objectbox, orm, performance, storm
- Language: Go
- Homepage:
- Size: 43.9 KB
- Stars: 6
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Performance tests
=================This is an open source benchmark to test the performance of ObjectBox and other databases that offer persistence of Go structs (e.g. GORM, Storm/bbolt).
Tests include:
* CRUD (create, read, update, delete) operations using batches of structs
* Lookup by IDs
* Query by prefixHow to run
----------For each database to test there's a command line executable represented by a main.go file in those directories:
* objectbox
* gorm
* bolt-stormThe following examples refer to the objectbox directory, but you can do the same for others.
To get good numbers, close all programs before running, build & run outside of IDE:
```shell script
cd objectbox
go build
./objectbox
```or you can use `go run ./objectbox` which does yield about the same results
Parameters
----------A typical invocation looks like this (e.g. 3 runs with 100K objects each run):
```
./objectbox -count 100000 -runs 3
```You can specify some parameters, see `./objectbox -h`:
```
Usage of ./objectbox:
-count int
number of objects (default 10000)
-db string
database directory (default "testdata")
-runs int
number of times the tests should be executed (default 10)
```Dev notes
---------
To regenerate ObjectBox entity bindings
```shell script
mv objectbox/obx/objectbox-model.* internal/models/
go run github.com/objectbox/objectbox-go/cmd/objectbox-gogen internal/models/entity.go
mv internal/models/entity.obx.go objectbox/obx/
mv internal/models/objectbox-model.* objectbox/obx/
for f in objectbox/obx/*.go; do sed -i 's/package models/package obx/g' "$f"; done
for f in objectbox/obx/*.obx.go; do sed -i '7 a . "github.com/objectbox/objectbox-go-performance/internal/models"' "$f"; done
```