Revision aacc71dc2956c5f8bc5b3bdced454691fa489266 authored by Alexander Bezobchuk on 31 July 2019, 15:01:55 UTC, committed by Jack Zampolin on 01 August 2019, 17:28:32 UTC
- Replace the previous intersect call, which was called at each query condition, with a map intersection.
- Replace fmt.Sprintf with string()

closes: #3076

Benchmarks

```
Old
goos: darwin
goarch: amd64
pkg: github.com/tendermint/tendermint/state/txindex/kv
BenchmarkTxSearch-4   	     200	 103641206 ns/op	 7998416 B/op	   71171 allocs/op
PASS
ok  	github.com/tendermint/tendermint/state/txindex/kv	26.019s

New
goos: darwin
goarch: amd64
pkg: github.com/tendermint/tendermint/state/txindex/kv
BenchmarkTxSearch-4   	    1000	  38615024 ns/op	13515226 B/op	  166460 allocs/op
PASS
ok  	github.com/tendermint/tendermint/state/txindex/kv	53.618s
```

~62% performance improvement

Commits:

* Refactor tx search

* Add pending changelog entry

* Add tx search benchmarking

* remove intermediate hashes list

also reset timer in BenchmarkTxSearch
and fix other benchmark

* fix import

* Add test cases

* Fix searching

* Replace fmt.Sprintf with string

* Update state/txindex/kv/kv.go

Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>

* Rename params

* Cleanup

* Check error in benchmarks
1 parent d56fb6e
History
File Mode Size
.circleci
.github
DOCKER
abci
behaviour
benchmarks
blockchain
cmd
config
consensus
crypto
docs
evidence
libs
lite
mempool
mock
networks
node
p2p
privval
proxy
rpc
scripts
state
store
test
tools
types
version
.editorconfig -rw-r--r-- 280 bytes
.gitignore -rw-r--r-- 494 bytes
.golangci.yml -rw-r--r-- 1.1 KB
CHANGELOG.md -rw-r--r-- 116.7 KB
CHANGELOG_PENDING.md -rw-r--r-- 2.0 KB
CODE_OF_CONDUCT.md -rw-r--r-- 4.9 KB
CONTRIBUTING.md -rw-r--r-- 8.6 KB
LICENSE -rw-r--r-- 11.1 KB
Makefile -rw-r--r-- 10.7 KB
PHILOSOPHY.md -rw-r--r-- 7.5 KB
README.md -rw-r--r-- 7.5 KB
ROADMAP.md -rw-r--r-- 861 bytes
SECURITY.md -rw-r--r-- 1.7 KB
UPGRADING.md -rw-r--r-- 17.2 KB
Vagrantfile -rw-r--r-- 2.0 KB
appveyor.yml -rw-r--r-- 251 bytes
codecov.yml -rw-r--r-- 330 bytes
docker-compose.yml -rw-r--r-- 1.3 KB
go.mod -rw-r--r-- 1.9 KB
go.sum -rw-r--r-- 14.7 KB

README.md

back to top