Page MenuHomePhabricator

Prevector Quick Destruct
ClosedPublic

Authored by deadalnix on Sep 30 2018, 14:40.

Details

Summary
  • Add prevector destructor benchmark
  • Only call clear on prevector if it isn't trivially destructible and don't loop in clear

This is a backport of Core PR9505

Test Plan
make
./src/bench/bench_bitcoin

Diff Detail

Repository
rABC Bitcoin ABC
Branch
prevectrodestruct
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 3450
Build 4976: Bitcoin ABC Buildbot (legacy)
Build 4975: arc lint + arc unit

Event Timeline

jasonbcox requested changes to this revision.Sep 30 2018, 16:50
jasonbcox added a subscriber: jasonbcox.
jasonbcox added inline comments.
src/bench/prevector_destructor.cpp
14 ↗(On Diff #5187)

Any reason t1 cannot be removed and the second resize be applied to t0?

27 ↗(On Diff #5187)

Same question as above.

28 ↗(On Diff #5187)

shouldn't this be t1?

This revision now requires changes to proceed.Sep 30 2018, 16:50
deadalnix added inline comments.
src/bench/prevector_destructor.cpp
14 ↗(On Diff #5187)

You want to check the destruction of vector that are within and out of bounds with the preallocated buffer.

28 ↗(On Diff #5187)

Probably. It's definitively t0 in core.

Fix t0.clear() => t1.clear()

This revision is now accepted and ready to land.Sep 30 2018, 19:29
This revision was automatically updated to reflect the committed changes.