Merge branch develop into claude/perf-contiguous-parser

Resolve the conflict in docs/mkdocs/docs/features/files.md (keep the
measured ifstream ratio of this PR, use develop's json_view/index.md link)
and regenerate the single include headers.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-11-09 09:07:53 +01:00
commit b2d379fe84
126 files changed
+74739 -763

No files matched your search

+33 -29
View File
@@ -25577,18 +25577,22 @@ class iter_impl // NOLINT(cppcoreguidelines-special-member-functions,hicpp-speci
{
JSON_ASSERT(m_object != nullptr);
if (JSON_HEDLEY_LIKELY(m_object->m_data.m_type == value_t::array))
{
JSON_ASSERT(m_it.array_iterator != m_object->m_data.m_value.array->end());
return *m_it.array_iterator;
}
// objects are tested before arrays here and in the other operators:
// with arrays first, walking a document of objects such as
// twitter.json took 14% more cycles than with 3.12.0's switch; with
// objects first, no document walks slower than with 3.12.0
if (JSON_HEDLEY_LIKELY(m_object->m_data.m_type == value_t::object))
{
JSON_ASSERT(m_it.object_iterator != m_object->m_data.m_value.object->end());
return m_it.object_iterator->second;
}
if (JSON_HEDLEY_LIKELY(m_object->m_data.m_type == value_t::array))
{
JSON_ASSERT(m_it.array_iterator != m_object->m_data.m_value.array->end());
return *m_it.array_iterator;
}
// neither array nor object: a primitive value (null has no value to point to)
if (JSON_HEDLEY_LIKELY(m_object->m_data.m_type != value_t::null && m_it.primitive_iterator.is_begin()))
{
@@ -25606,18 +25610,18 @@ class iter_impl // NOLINT(cppcoreguidelines-special-member-functions,hicpp-speci
{
JSON_ASSERT(m_object != nullptr);
if (JSON_HEDLEY_LIKELY(m_object->m_data.m_type == value_t::array))
{
JSON_ASSERT(m_it.array_iterator != m_object->m_data.m_value.array->end());
return &*m_it.array_iterator;
}
if (JSON_HEDLEY_LIKELY(m_object->m_data.m_type == value_t::object))
{
JSON_ASSERT(m_it.object_iterator != m_object->m_data.m_value.object->end());
return &(m_it.object_iterator->second);
}
if (JSON_HEDLEY_LIKELY(m_object->m_data.m_type == value_t::array))
{
JSON_ASSERT(m_it.array_iterator != m_object->m_data.m_value.array->end());
return &*m_it.array_iterator;
}
// neither array nor object: a primitive value
if (JSON_HEDLEY_LIKELY(m_it.primitive_iterator.is_begin()))
{
@@ -25646,18 +25650,18 @@ class iter_impl // NOLINT(cppcoreguidelines-special-member-functions,hicpp-speci
{
JSON_ASSERT(m_object != nullptr);
if (JSON_HEDLEY_LIKELY(m_object->m_data.m_type == value_t::array))
{
++m_it.array_iterator;
return *this;
}
if (JSON_HEDLEY_LIKELY(m_object->m_data.m_type == value_t::object))
{
std::advance(m_it.object_iterator, 1);
return *this;
}
if (JSON_HEDLEY_LIKELY(m_object->m_data.m_type == value_t::array))
{
++m_it.array_iterator;
return *this;
}
// neither array nor object: a primitive value
++m_it.primitive_iterator;
return *this;
@@ -25682,18 +25686,18 @@ class iter_impl // NOLINT(cppcoreguidelines-special-member-functions,hicpp-speci
{
JSON_ASSERT(m_object != nullptr);
if (JSON_HEDLEY_LIKELY(m_object->m_data.m_type == value_t::array))
{
--m_it.array_iterator;
return *this;
}
if (JSON_HEDLEY_LIKELY(m_object->m_data.m_type == value_t::object))
{
std::advance(m_it.object_iterator, -1);
return *this;
}
if (JSON_HEDLEY_LIKELY(m_object->m_data.m_type == value_t::array))
{
--m_it.array_iterator;
return *this;
}
// neither array nor object: a primitive value
--m_it.primitive_iterator;
return *this;
@@ -25715,16 +25719,16 @@ class iter_impl // NOLINT(cppcoreguidelines-special-member-functions,hicpp-speci
return true;
}
if (JSON_HEDLEY_LIKELY(m_object->m_data.m_type == value_t::array))
{
return (m_it.array_iterator == other.m_it.array_iterator);
}
if (JSON_HEDLEY_LIKELY(m_object->m_data.m_type == value_t::object))
{
return (m_it.object_iterator == other.m_it.object_iterator);
}
if (JSON_HEDLEY_LIKELY(m_object->m_data.m_type == value_t::array))
{
return (m_it.array_iterator == other.m_it.array_iterator);
}
// neither array nor object: a primitive value
return (m_it.primitive_iterator == other.m_it.primitive_iterator);
}