jgarzik / univalue

High performance RAII C++ JSON library and universal value object class
MIT License
56 stars 77 forks source link

Remove hand-coded Univalue destructor. #62

Closed martinus closed 5 years ago

martinus commented 5 years ago

When the hand-written destructor is removed, the compiler will automatically create a proper one, with correct noexcept. This allows std::vector<UniValue> to be resized without having to copy all elements first, which makes JSON generation of a bitcoin block (as in the benchmark "BlockToJsonVerbose") 25% faster on my machine.

jgarzik commented 5 years ago

@martinus Very interesting - taking a look - why closed?

martinus commented 5 years ago

I actually wanted to push this to the bitcoin-core/univalue fork, so I've closed it here and pushed it there. It's still a valid patch I guess

jgarzik commented 5 years ago

@martinus This is the upstream univalue repo