nstream Performance
novalexei edited this page Oct 20, 2017
·
12 revisions
This is very quick performance test of various string streams. In this test we write random integer into string and read it back from that string and make sure that initial and resulting numbers are equal. The contestants:
- Standard istringstream/ostringstream
- boost::iostreams with sink and source described in boost::iostreams tutorial
- nova::stream with in_buffer_provider and out_buffer_provider described in sections "Writing input stream with in_buffer_provider" and "Writing output stream with out_buffer_provider" with minor change in out_buffer_provider to implement small string optimization.
Here are the result:
stream | Execution time (ms) | Compiled size (stripped) |
---|---|---|
stringstream | 6002 | 8224 |
boost::iostreams | 4567 | 24704 |
nova::stream | 3890 | 8272 |
Back to the Tutorial