store

package
v0.2.134 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2019 License: BSD-2-Clause Imports: 1 Imported by: 0

README

store

benchmark

  • sqliteは過去の履歴にアクセスできるように実装したが,それにしても他の実装と比較して遅いことがわかる
  • leveldb は平均的に read, write の性能ともに良い
    • 耐障害性がよくわからないため,第十日どうか判断できていないがとりあえずleveldbを利用することにする
memory read
goos: linux
goarch: amd64
pkg: github.com/n0stack/n0stack/n0core/pkg/datastore/store/memory
BenchmarkMemoryStoreGet-8       20000000            59.2 ns/op           0 B/op           0 allocs/op
PASS
ok      github.com/n0stack/n0stack/n0core/pkg/datastore/store/memory    5.438s
Success: Benchmarks passed.
memory write
goos: linux
goarch: amd64
pkg: github.com/n0stack/n0stack/n0core/pkg/datastore/store/memory
BenchmarkMemoryStoreApply-8       20000000            76.8 ns/op           7 B/op           1 allocs/op
PASS
ok      github.com/n0stack/n0stack/n0core/pkg/datastore/store/memory    3.630s
Success: Benchmarks passed.
sqlite read
goos: linux
goarch: amd64
pkg: github.com/n0stack/n0stack/n0core/pkg/datastore/store/sqlite
BenchmarkSqliteStoreGet-8          30000         64989 ns/op        9757 B/op         198 allocs/op
PASS
ok      github.com/n0stack/n0stack/n0core/pkg/datastore/store/sqlite    81.512s
Success: Benchmarks passed.
sqlite write
goos: linux
goarch: amd64
pkg: github.com/n0stack/n0stack/n0core/pkg/datastore/store/sqlite
BenchmarkSqliteStoreApply-8           1000       2184621 ns/op        7940 B/op         168 allocs/op
PASS
ok      github.com/n0stack/n0stack/n0core/pkg/datastore/store/sqlite    2.421s
Success: Benchmarks passed.
leveldb read
goos: linux
goarch: amd64
pkg: github.com/n0stack/n0stack/n0core/pkg/datastore/store/leveldb
BenchmarkSqliteStoreApply-8        1000000          3615 ns/op         580 B/op          10 allocs/op
PASS
ok      github.com/n0stack/n0stack/n0core/pkg/datastore/store/leveldb    7.887s
Success: Benchmarks passed.
leveldb write
goos: linux
goarch: amd64
pkg: github.com/n0stack/n0stack/n0core/pkg/datastore/store/leveldb
BenchmarkSqliteStoreApply-8         300000          4857 ns/op         287 B/op           4 allocs/op
PASS
ok      github.com/n0stack/n0stack/n0core/pkg/datastore/store/leveldb    3.239s
Success: Benchmarks passed.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotFound

func IsNotFound(err error) bool

Types

type NotFound

type NotFound struct {
	// contains filtered or unexported fields
}

func NewNotFound

func NewNotFound(key string) *NotFound

func (NotFound) Error

func (e NotFound) Error() string

func (NotFound) IsNotFound

func (e NotFound) IsNotFound() bool

type NotFoundError

type NotFoundError interface {
	IsNotFound() bool

	Error() string
}

type Store

type Store interface {
	List() ([][]byte, error)
	Get(key string) ([]byte, error)
	Apply(key string, value []byte) error
	Delete(key string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL