mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-01 01:50:51 +02:00
common: add json.h abstraction (#27511)
* add common/json * migrate common * adapt jinja * migrate server * big wip * migrate tests * wip * revert some excessive changes * wip * wip 2 * revert redundant changes * fix server crash * various fixes * fix ci * harden a bit * clean up * rm json-shim * add some comments * rm redundant decl
This commit is contained in:
@@ -8,7 +8,7 @@ void test_json_serialization(testing &t) {
|
||||
auto json_serialized = original.to_json().dump();
|
||||
|
||||
t.test("compare before/after", [&](testing &t) {
|
||||
auto deserialized = common_peg_arena::from_json(nlohmann::json::parse(json_serialized));
|
||||
auto deserialized = common_peg_arena::from_json(common_json::parse(json_serialized));
|
||||
|
||||
// Test complex JSON
|
||||
std::string input = R"({"name": "test", "values": [1, 2, 3], "nested": {"a": true}})";
|
||||
@@ -23,6 +23,6 @@ void test_json_serialization(testing &t) {
|
||||
});
|
||||
|
||||
t.bench("deserialize", [&]() {
|
||||
auto deserialized = common_peg_arena::from_json(nlohmann::json::parse(json_serialized));
|
||||
auto deserialized = common_peg_arena::from_json(common_json::parse(json_serialized));
|
||||
}, 100);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user