This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
univalue optimizations: move semantics, reduce temporary strings
* Introducing move semantics for pushKV and push_back. In many use cases the const& calls unnecessarily create a copy of the argument, when objects can be moved this does not happen. * Reduce creation of temporary strings. `json_escape` and `write` now appends to an existing string instead of creating a temporary. * Use `std::to_string` instead of `std::ostringstream` for `setNumStr`, which is much faster than creating a temporary string. In a benchmark with Bitcoin's BlockToJsonVerbose, using these move methods where possible speeds up JSON generation by about a factor of 2.
- Loading branch information
Showing
4 changed files
with
151 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters