Qt中的JSON类与c++中的其他JSON解析器
JSON classes in Qt vs other JSON parsers in C++
我正在用c++开发一个服务器/客户端应用程序,我使用Qt作为我的IDE以及它的一些库。在性能方面,我被告知在服务器和客户端之间传输数据的最佳方式之一是通过JSON。然而,我想知道在Qt (QJsonArray,QJsonObject..)中解析JSON的默认类之间的性能差异。等)和其他c++解析器,例如JSON++ .
如果Qt类性能不够,您可以查看RapidJson: https://github.com/miloyip/rapidjson
性能比较:http://code.google.com/p/rapidjson/wiki/Performance
RapidJson的优点(除了它的速度)是容易安装和使用。来自他们的网站:rapidjson是一个头文件库。这意味着,唯一要做的就是复制rapidjson/include/rapidjson及其子目录到你的项目或其他包含路径。
这个例子也来自他们的维基页面:
#include "rapidjson/document.h"
#include <cstdio>
int main() {
const char json[] = "{ "hello" : "world" }";
rapidjson::Document d;
d.Parse<0>(json);
printf("%sn", d["hello"].GetString());
return 0;
}
相关文章:
- 在执行其他功能的同时播放动画(LED矩阵和Arduino/ESP8266)
- 将数组作为参数传递给函数安全吗?作为第三方职能部门,可以探索他们想要的之外的其他元素
- 在c++中使用nlohmann从类到json的转换
- 有没有什么方法可以使用一个函数中定义的常量变量,也可以由c++中同一程序中的其他函数使用
- C++json插入数组
- GL_SHADERSTORAGE_BUFFER位置是否与其他着色器位置冲突
- 为什么我不能在 C++ 中的特定函数重载中调用同一函数的任何其他重载?
- nlohmann-json将一个数组插入到另一个数组中
- 在其他文件中创建类时在 c++ 项目中不起作用
- 类与私有变量的其他类之间的线程安全性
- 如何使用curlpp通过POST方法上传文件和json数据
- 将--whole archive链接器选项与CMake和具有其他库依赖项的库一起使用
- JSON转换为nlohmann JSON-lib中的结构数组
- GlobalAlloc而不是其他分配方法
- C++从其他 constexpr 创建 lambda 不能按顺序执行 Constexpr
- NLOHMANN 的 JSON 库将数组转换为结构向量
- 在nlohmann json中,如何将嵌套对象的数组转换为嵌套结构的向量
- 断言中的Fold表达式在某些计算机上编译,但在其他计算机上不编译
- 如何通过将JSON数据修改为RapidJson通过将其修改为其他模式
- Qt中的JSON类与c++中的其他JSON解析器