Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
072ee2af83 |
No files matched your search
@@ -1322,8 +1322,9 @@ class json_sax_dom_parser : public json_sax_dom_error_state
|
||||
}
|
||||
|
||||
/// the number of members an object collects on the stack before it
|
||||
/// switches to storing them directly
|
||||
static constexpr std::size_t object_buffer_limit = 32;
|
||||
/// switches to storing them directly; this is the size from which the
|
||||
/// stored object looks up its keys in a hash table (key_index_threshold)
|
||||
static constexpr std::size_t object_buffer_limit = 64;
|
||||
|
||||
void reserve_members()
|
||||
{
|
||||
|
||||
@@ -1510,19 +1510,7 @@ class serializer
|
||||
{
|
||||
flush();
|
||||
}
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
std::size_t copy_length = length;
|
||||
// GCC knows from the test above that the length is below the size of
|
||||
// the write buffer, and with that bound it may expand the memcpy into
|
||||
// "rep movsq" (seen with -march=x86-64-v3 and -mtune=generic) instead
|
||||
// of calling memcpy. For the short runs written here its start-up cost
|
||||
// is far above that of the call (dump() with ensure_ascii 80 % slower
|
||||
// on Sapphire Rapids), so hide the bound from the optimizer.
|
||||
__asm__("" : "+r"(copy_length));
|
||||
#else
|
||||
const std::size_t copy_length = length;
|
||||
#endif
|
||||
std::memcpy(write_buffer.data() + write_buffer_pos, s, copy_length);
|
||||
std::memcpy(write_buffer.data() + write_buffer_pos, s, length);
|
||||
write_buffer_pos += length;
|
||||
}
|
||||
|
||||
|
||||
Generated
+4
-15
@@ -17540,8 +17540,9 @@ class json_sax_dom_parser : public json_sax_dom_error_state
|
||||
}
|
||||
|
||||
/// the number of members an object collects on the stack before it
|
||||
/// switches to storing them directly
|
||||
static constexpr std::size_t object_buffer_limit = 32;
|
||||
/// switches to storing them directly; this is the size from which the
|
||||
/// stored object looks up its keys in a hash table (key_index_threshold)
|
||||
static constexpr std::size_t object_buffer_limit = 64;
|
||||
|
||||
void reserve_members()
|
||||
{
|
||||
@@ -39101,19 +39102,7 @@ class serializer
|
||||
{
|
||||
flush();
|
||||
}
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
std::size_t copy_length = length;
|
||||
// GCC knows from the test above that the length is below the size of
|
||||
// the write buffer, and with that bound it may expand the memcpy into
|
||||
// "rep movsq" (seen with -march=x86-64-v3 and -mtune=generic) instead
|
||||
// of calling memcpy. For the short runs written here its start-up cost
|
||||
// is far above that of the call (dump() with ensure_ascii 80 % slower
|
||||
// on Sapphire Rapids), so hide the bound from the optimizer.
|
||||
__asm__("" : "+r"(copy_length));
|
||||
#else
|
||||
const std::size_t copy_length = length;
|
||||
#endif
|
||||
std::memcpy(write_buffer.data() + write_buffer_pos, s, copy_length);
|
||||
std::memcpy(write_buffer.data() + write_buffer_pos, s, length);
|
||||
write_buffer_pos += length;
|
||||
}
|
||||
|
||||
|
||||
@@ -247,8 +247,8 @@ TEST_CASE("regression test for issue #5673 - ordered_json::emplace with a non-rv
|
||||
namespace
|
||||
{
|
||||
// the sizes around which the DOM parser changes how it stores the elements of
|
||||
// an array (16) and the members of an object in a vector (32, and 64 for the
|
||||
// key index)
|
||||
// an array (16) and the members of an object in a vector (64, which is also
|
||||
// where the key index starts)
|
||||
const std::array<std::size_t, 17> container_sizes = {{0, 1, 2, 3, 15, 16, 17, 18, 31, 32, 33, 34, 63, 64, 65, 66, 200}};
|
||||
|
||||
template<typename Json>
|
||||
|
||||
Reference in new issue
Block a user