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
bench_test.go -rw-r--r-- 1.6 KB
cache_test.go -rw-r--r-- 3.2 KB
clist_mempool.go -rw-r--r-- 19.9 KB
clist_mempool_test.go -rw-r--r-- 18.6 KB
codec.go -rw-r--r-- 143 bytes
doc.go -rw-r--r-- 1.2 KB
errors.go -rw-r--r-- 1.1 KB
mempool.go -rw-r--r-- 5.0 KB
metrics.go -rw-r--r-- 2.4 KB
reactor.go -rw-r--r-- 7.7 KB
reactor_test.go -rw-r--r-- 5.5 KB

back to top