Coder Social home page Coder Social logo

objectbox / objectbox-go-performance Goto Github PK

View Code? Open in Web Editor NEW
6.0 4.0 1.0 45 KB

Open Source Performance Benchmarks for ObjectBox Go, GORM, and others

License: Apache License 2.0

Go 100.00%
bbolt database golang gorm objectbox orm performance storm

objectbox-go-performance's Introduction

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 prefix

How 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-storm

The 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:

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

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

objectbox-go-performance's People

Contributors

greenrobot avatar vaind avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

arthit2516

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.