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

Experiments #141

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ bond-cli

.ipynb_checkpoints
*.ipynb

_benchmarks/bench_db
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
SHELL = bash -o pipefail
TEST_FLAGS ?= -p 1 -v -race


all:
@echo "make <cmd>"
@echo ""
Expand Down Expand Up @@ -39,17 +38,13 @@ test-all: test-clean
test-with-reset: db-reset test-all

test-clean:
GOGC=off go clean -testcache && rm -rf test_db tmp_db
GOGC=off go clean -testcache && rm -rf test_db tmp_db _benchmarks/bench_db

bench:
@cd _benchmarks && go test -timeout=25m -bench=.

bench-csv:
go run ./_benchmarks/benchmark.go --report=csv
@cd _benchmarks && go run ./benchmark.go --report=csv

todo:
@git grep TODO -- './*' ':!./vendor/' ':!./Makefile' || :

.PHONY: pb
pb:
protoc -I=./tests/pb --go_out=./tests ./tests/pb/demo.proto
28 changes: 6 additions & 22 deletions _benchmarks/suites/table_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,13 @@ import (
"github.com/go-bond/bond"
)

//go:generate msgp

type TokenBalance struct {
ID uint64 `json:"id"`
AccountID uint32 `json:"accountId"`
ContractAddress string `json:"contractAddress"`
AccountAddress string `json:"accountAddress"`
TokenID uint32 `json:"tokenId"`
Balance uint64 `json:"balance"`
}

type TokenBalanceSerializer struct {
}

func (s *TokenBalanceSerializer) Serialize(tb **TokenBalance) ([]byte, error) {
return (*tb).MarshalMsg(make([]byte, 0, (*tb).Msgsize()))
}

func (s *TokenBalanceSerializer) Deserialize(b []byte, tb **TokenBalance) error {
nTb := &TokenBalance{}
_, err := nTb.UnmarshalMsg(b)
*tb = nTb
return err
ID uint64 `json:"id" cbor:"1"`
AccountID uint32 `json:"accountId" cbor:"2"`
ContractAddress string `json:"contractAddress" cbor:"3"`
AccountAddress string `json:"accountAddress" cbor:"4"`
TokenID uint32 `json:"tokenId" cbor:"5"`
Balance uint64 `json:"balance" cbor:"6"`
}

const dbName = "bench_db"
Expand Down
235 changes: 0 additions & 235 deletions _benchmarks/suites/table_common_gen.go

This file was deleted.

Loading