Chinese (Simplified Han script) (Boost Json Translation - en to zh_Hans translation catalogue (79 entries)

en: = Benchmarks This section compares the performance of Boost.JSON with two widely used libraries with similar functionality: RapidJSON which is known for its performance, and JSON for Modern C++ which is known for feature-richness. The bench program measures the throughput of parsing and serialization for the a set of JSON representing typical workloads. These implementations are evaluated:
zh_Hans: = 基准测试 本节将 Boost.JSON 与两个广泛使用的具有类似功能的库进行性能比较：以高性能著称的 RapidJSON 和以功能丰富著称的JSON for Modern C++ 库（nlohmann/json）。bench 程序测量解析和序列化一组代表典型工作负载的 JSON 的吞吐量。评估的实现包括：

[ctx: :21]
en: Name
zh_Hans: 使用 &lt;&gt; 解析输入，该资源针对解析后不进行后续修改的场景进行了优化。&lt;&gt; 对象在各次试验之间被复用，使得实现所分配的临时内存得以保留，从而提升性能。

[ctx: :21]
en: Description
zh_Hans: 描述

en: *boost(pool)*
zh_Hans: *boost*

en: Parses the input using a <<ref_monotonic_resource>>,
zh_Hans: 使用 &lt;&gt; 对输入进行解析，

en: which is optimized for parsing without subsequent modification. The <<ref_stream_parser>> object is reused between trials, allowing temporary memory allocated by the implementation to persist and improve performance.
zh_Hans: 该资源针对解析后不进行后续修改的场景进行了优化。&lt;<ref_stream_parser>&gt; 对象在各次试验之间被复用，使得实现所分配的临时内存得以保留，从而提升性能。</ref_stream_parser>

en: Parses the input using the <<default_memory_resource, default memory
zh_Hans: 使用 &lt;&gt; 对输入进行解析，

en: resource>>, which uses the standard C++ allocator, and is designed for general use including mutation of the document after it is parsed. The <<ref_stream_parser>> object is reused between trials, allowing temporary memory allocated by the implementation to persist and improve performance.
zh_Hans: resource&gt;&gt;, which uses the standard C++ allocator, and is designed for general use including mutation of the document after it is parsed. The &lt;<ref_stream_parser>&gt; object is reused between trials, allowing temporary memory allocated by the implementation to persist and improve performance.</ref_stream_parser>

[ctx: :39]
en: Parses the input using an instance of
zh_Hans: 对输入进行解析，该解析式通过使用

en: https://rapidjson.org/classrapidjson_1_1_memory_pool_allocator.html[`MemoryPoolAllocator`], which is optimized for parsing without subsequent modification. The https://rapidjson.org/classrapidjson_1_1_generic_document.html[`Document`] object holding temporary memory is not reused between trials, otherwise memory consumption grows without bounds and invalidates the benchmark.
zh_Hans: https://rapidjson.org/classrapidjson_1_1_memory_pool_allocator.html[`MemoryPoolAllocator`] 的实例实现的，该分配器针对“仅解析、不修改”的场景进行了优化。持有临时内存的 https://rapidjson.org/classrapidjson_1_1_generic_document.html[`Document`] 对象在多次测试之间不重复使用，否则内存消耗将无限增长，从而导致基准测试结果无效。

[ctx: :47]
en: Parses the input using an instance of
zh_Hans: 对输入进行解析，该解析是通过使用

en: https://rapidjson.org/classrapidjson_1_1_crt_allocator.html[`CrtAllocator`], which uses the standard C++ allocator, and is designed for general use including mutation of the document after it is parsed. The https://rapidjson.org/classrapidjson_1_1_generic_document.html[`Document`] object holding temporary memory is not reused between trials, otherwise memory consumption grows without bounds and invalidates the benchmark.
zh_Hans: 使用 https://rapidjson.org/classrapidjson_1_1_crt_allocator.html[`CrtAllocator`] 的实例来实现的，该分配器使用标准 C++ 分配器，适用于通用场景，包括解析后对文档的修改。持有临时内存的 https://rapidjson.org/classrapidjson_1_1_generic_document.html[`Document`] 对象在多次测试之间不重复使用，否则内存消耗将无限增长，导致基准测试结果无效。

en: Parses the input using the static member function
zh_Hans: 对输入进行解析，该解析式通过使用静态成员函数

en: https://nlohmann.github.io/json/classnlohmann_1_1basic__json_ab330c13ba254ea41fbc1c52c5c610f45.html[`json::parse`], which uses the default `std` allocator, and is designed for general use including mutation of the document after it is parsed. This library does not provide an interface to reuse temporary storage used during parsing or serialization on subsequent operations. |===
zh_Hans: https://nlohmann.github.io/json/classnlohmann_1_1basic__json_ab330c13ba254ea41fbc1c52c5c610f45.html[`json::parse`] 来实现的，该函数使用默认的 `std` 分配器，适用于通用场景，包括解析后对文档的修改。该库未提供复用解析或序列化过程中所用临时存储的接口，因此无法在后续操作中重用这些临时内存。

en: Methodology
zh_Hans: 方法论

en: The input files are all loaded first. Then each configuration is run for a sufficient number of trials to last at least 5 seconds. The elapsed time, number of invocations (of parse or serialize), and bytes transferred are emitted as a sample along with a calculation of throughput expressed in megabytes per second. Several samples (currently five) are generated for each configuration. All but the median two samples are discarded, with the remaining samples averaged to produce a single number which is reported as the benchmark result.
zh_Hans: 首先加载所有输入文件。随后，每种配置会运行足够多的试验次数，以确保总运行时间不少于 5 秒。每次试验会记录所用时间、调用次数（解析或序列化）以及传输的字节数，并以此生成一个样本，同时计算出以 MB/s（兆字节每秒）为单位的吞吐量。每种配置会生成多个样本（目前为五个），剔除其中非中间两个的样本后，对剩余的两个样本取平均值，作为该配置的最终基准测试结果。

en: The input files, available in the bench/data directory, are laid out thusly:
zh_Hans: 输入文件位于 bench/data 目录，按如下方式布局：

[ctx: :78]
en: Name
zh_Hans: 125KB

[ctx: :78]
en: Description
zh_Hans: 描述

en: <<parse_apache_builds_json,*apache_builds.json*>>
zh_Hans: &lt;<parse_apache_builds_json,*apache_builds.json*>&gt;</parse_apache_builds_json,*apache_builds.json*>

en: Data from the Apache Jenkins installation.
zh_Hans: 来自 Apache Jenkins 安装的数据。

en: <<parse_canada_json,*canada.json*>>
zh_Hans: &lt;<parse_canada_json,*canada.json*>&gt;</parse_canada_json,*canada.json*>

en: The largest file, containing a large number of 2-element arrays holding
zh_Hans: 最大的文件，包含大量二元数组。

en: floating-point coordinate pairs.
zh_Hans: （该二元数组是由）浮点坐标对（组成的）

en: <<parse_citm_catalog_json,*citm_catalog.json*>>
zh_Hans: &lt;<parse_citm_catalog_json,*citm_catalog.json*>&gt;</parse_citm_catalog_json,*citm_catalog.json*>

en: A large JSON with a variety of nesting, types, and lengths.
zh_Hans: 一个包含多种嵌套结构、数据类型和长度的大型 JSON。

en: <<parse_github_events_json,*github_events.json*>>
zh_Hans: &lt;<parse_github_events_json,*github_events.json*>&gt;</parse_github_events_json,*github_events.json*>

en: An export of data from the Github Events API.
zh_Hans: 一份来自 GitHub Events API 的数据导出。

en: <<parse_gsoc_2018_json,*gsoc-2018.json*>>
zh_Hans: &lt;<parse_gsoc_2018_json,*gsoc-2018.json*>&gt;</parse_gsoc_2018_json,*gsoc-2018.json*>

en: <<parse_instruments_json,*instruments.json*>>
zh_Hans: &lt;<parse_instruments_json,*instruments.json*>&gt;</parse_instruments_json,*instruments.json*>

en: An array of large objects.
zh_Hans: 一个由大型对象组成的数组。

en: <<parse_marine_ik_json,*marine_ik.json*>>
zh_Hans: &lt;<parse_marine_ik_json,*marine_ik.json*>&gt;</parse_marine_ik_json,*marine_ik.json*>

en: A three.js example model serialized to JSON.
zh_Hans: 一个以 JSON 格式序列化的 three.js 示例模型。

en: <<parse_mesh_json,*mesh.json*>>
zh_Hans: &lt;<parse_mesh_json,*mesh.json*>&gt;</parse_mesh_json,*mesh.json*>

en: A JSON representing a 3D mesh. Contains many floating-point numbers.
zh_Hans: 一个表示三维网格的 JSON ，（该 JSON ）包含大量浮点数。

en: <<parse_mesh_pretty_json,*mesh.pretty.json*>>
zh_Hans: &lt;<parse_mesh_pretty_json,*mesh.pretty.json*>&gt;</parse_mesh_pretty_json,*mesh.pretty.json*>

en: mesh.json with whitespace added.
zh_Hans: 添加了空格的 mesh.json。

en: <<parse_numbers_json,*numbers.json*>>
zh_Hans: &lt;<parse_numbers_json,*numbers.json*>&gt;</parse_numbers_json,*numbers.json*>

en: A array containing only floating-point numbers.
zh_Hans: 一个仅包含浮点数的数组。

en: <<parse_random_json,*random.json*>>
zh_Hans: &lt;<parse_random_json,*random.json*>&gt;</parse_random_json,*random.json*>

en: A JSON with lots of Cyrillic characters.
zh_Hans: 一个包含大量 Cyrillic （西里尔）字符的 JSON。

en: <<parse_twitter_json,*twitter.json*>>
zh_Hans: &lt;<parse_twitter_json,*twitter.json*>&gt;</parse_twitter_json,*twitter.json*>

[ctx: :90]
en: An export of data from Twitter's API.
zh_Hans: 一份来自 Twitter API 的数据导出。

en: <<parse_twitterescaped_json,*twitterescaped.json*>>
zh_Hans: &lt;<parse_twitterescaped_json,*twitterescaped.json*>&gt;</parse_twitterescaped_json,*twitterescaped.json*>

en: twitter.json with whitespace removed and non-ASCII characters replaced with
zh_Hans: twitter.json ，是移除空格并将非 ASCII 字符替换为

en: Unicode escapes.
zh_Hans: Unicode 转义符的。

en: <<parse_update_center_json,*update-center.json*>>
zh_Hans: &lt;<parse_update_center_json,*update-center.json*>&gt;</parse_update_center_json,*update-center.json*>

[ctx: :135]
en: An export of data from Twitter's API.
zh_Hans: 一份来自 Twitter API 的数据导出。

en: Hardware used for testing: **Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz**, Windows 10, 32GB RAM.
zh_Hans: 测试所用硬件：  **Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz**, Windows 10, 32GB RAM.

en: Compilers and optimization flags: gcc 8.1 (-O3), clang 12.0 (-O3), and msvc 19.26 (/O2).
zh_Hans: 编译器及优化选项: gcc 8.1 (-O3), clang 12.0 (-O3), and msvc 19.26 (/O2).

en: Parsing
zh_Hans: 解析

en: Parse apache_builds.json
zh_Hans: 解析 apache_builds.json

en: Parse canada.json
zh_Hans: 解析 canada.json

en: Parse citm_catalog.json
zh_Hans: 解析 citm_catalog.json

en: Parse github_events.json
zh_Hans: 解析 github_events.json

en: Parse gsoc-2018.json
zh_Hans: 解析 gsoc-2018.json

en: Parse instruments.json
zh_Hans: 解析 instruments.json

en: Parse marine_ik.json
zh_Hans: 解析 marine_ik.json

en: Parse mesh.json
zh_Hans: 解析 mesh.json

en: Parse mesh.pretty.json
zh_Hans: 解析 mesh.pretty.json

en: Parse numbers.json
zh_Hans: 解析 numbers.json

en: Parse random.json
zh_Hans: 解析 random.json

en: Parse twitter.json
zh_Hans: 解析 twitter.json

en: Parse twitterescaped.json
zh_Hans: 解析 twitterescaped.json

en: Parse update-center.json
zh_Hans: 解析 update-center.json

en: Serialization
zh_Hans: 序列化

en: Serialize canada.json
zh_Hans: 序列化 canada.json

en: Serialize citm_catalog.json
zh_Hans: 序列化 citm_catalog.json

en: Serialize github_events.json
zh_Hans: 序列化 github_events.json

en: Serialize gsoc-2018.json
zh_Hans: 序列化 gsoc-2018.json

en: Serialize instruments.json
zh_Hans: 序列化 instruments.json

en: Serialize marine_ik.json
zh_Hans: 序列化 marine_ik.json

en: Serialize mesh.json
zh_Hans: 序列化 mesh.json

en: Serialize mesh.pretty.json
zh_Hans: 序列化 mesh.pretty.json

en: Serialize numbers.json
zh_Hans: 序列化 numbers.json

en: Serialize random.json
zh_Hans: 序列化 random.json

en: Serialize twitter.json
zh_Hans: 序列化 twitter.json

en: Serialize twitterescaped.json
zh_Hans: 序列化 twitterescaped.json

en: Serialize update-center.json
zh_Hans: 序列化 update-center.json
