MCPcopy Create free account
hub / github.com/boostorg/json / serialize

Method serialize

bench/bench-conv.cpp:568–601  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

566 }
567
568 clock_type::duration
569 serialize(file_item const& fi, std::size_t repeat) const override
570 {
571 monotonic_resource mr;
572 storage_ptr sp;
573 if(is_pool_)
574 sp = &mr;
575 value jv = boost::json::parse( fi.text, std::move(sp) );
576 data_holder data = construct_data(fi.index, jv);
577
578 auto const start = clock_type::now();
579 serializer sr;
580 string out;
581 out.reserve(512);
582 while(repeat--)
583 {
584 mpl::mp_with_index<supported_file_count>(
585 fi.index, convert_to_value{data, jv});
586 sr.reset(&jv);
587 out.clear();
588 for(;;)
589 {
590 out.grow(sr.read(
591 out.end(),
592 out.capacity() -
593 out.size()).size());
594 if(sr.done())
595 break;
596 out.reserve(
597 out.capacity() + 1);
598 }
599 }
600 return clock_type::now() - start;
601 }
602};
603
604class boost_simple_impl : public base_boost_impl

Callers

nothing calls this directly

Calls 9

reserveMethod · 0.45
resetMethod · 0.45
clearMethod · 0.45
growMethod · 0.45
sizeMethod · 0.45
readMethod · 0.45
endMethod · 0.45
capacityMethod · 0.45
doneMethod · 0.45

Tested by

no test coverage detected