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

Method parse_file

bench/bench.cpp:889–906  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

887 }
888
889 clock_type::duration
890 parse_file(file_item const& fi, std::size_t repeat) const override
891 {
892 auto const start = clock_type::now();
893 char* s = new char[ fi.text.size() ];
894 std::unique_ptr<char[]> holder(s);
895
896 while(repeat--)
897 {
898 FILE* f = fopen(fi.name.data(), "rb");
899 std::size_t const sz = fread(s, 1, fi.text.size(), f);
900
901 auto jv = nlohmann::json::parse(s, s + sz);
902
903 fclose(f);
904 }
905 return clock_type::now() - start;
906 }
907
908 clock_type::duration
909 serialize_string(file_item const& fi, std::size_t repeat) const override

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected