diff options
author | Mission Liao <mission.liao@dexon.org> | 2018-08-28 13:13:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-28 13:13:21 +0800 |
commit | 7e9d2db5576d697b578669c935b2e7bbf9422ec7 (patch) | |
tree | e4fb9f4b95b23934a142a88ee05fbd49dff50b3c /integration_test | |
parent | 9c8f9a447bfd768a7b29db904bd604410ec66a09 (diff) | |
download | dexon-consensus-7e9d2db5576d697b578669c935b2e7bbf9422ec7.tar.gz dexon-consensus-7e9d2db5576d697b578669c935b2e7bbf9422ec7.tar.zst dexon-consensus-7e9d2db5576d697b578669c935b2e7bbf9422ec7.zip |
core: tune performance (#73)
- Avoid using recursive function in critical path.
- Do not write through when using levelDB. Things put to
levelDB would be safe from panic even we didn't force
to write through every time.
- Dump count of confirmed blocks proposed by self.
- Avoid allocating variables in loop.
- Return length of acking node set, we only need that
when total ordering.
- Fix potential bug: make sure win records updated when
acking height vectors of candidates are changed.
- Keep dirty validators in slice.
- Add cache for objects to ease the pressure to garbage
collector.
- Cache global acking status when total ordering.
- Add method to recycle blocks.
- Marshal JSON should be called once for each broadcast.
- Make updateWinRecord called in parallel.
- Log average / deviation of latencies when simulation
finished.
Diffstat (limited to 'integration_test')
-rw-r--r-- | integration_test/validator.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/integration_test/validator.go b/integration_test/validator.go index fd7a7ad..2cb7e43 100644 --- a/integration_test/validator.go +++ b/integration_test/validator.go @@ -107,6 +107,7 @@ func (v *Validator) handleProposeBlock(when time.Time, piggyback interface{}) ( events []*test.Event, err error) { b := &types.Block{ProposerID: v.ID} + defer types.RecycleBlock(b) if err = v.cons.PrepareBlock(b, when); err != nil { return } |