Add read-update-write benchmark

Update the README with a new benchmark group and performance results.
Include new data files and update the Rust benchmark implementation.
Regenerate UPB bindings and fix a data path in the C benchmark runner.
This commit is contained in:
2026-05-04 23:37:36 -07:00
parent a0c2747583
commit d21ff797b0
9 changed files with 505 additions and 329 deletions
+124 -58
View File
@@ -13,49 +13,73 @@
// Must be last.
#include "upb/port/def.inc"
extern const struct upb_MiniTable UPB_PRIVATE(_kUpb_MiniTable_StaticallyTreeShaken);
static const upb_MiniTableField Tool__fields[5] = {
extern const UPB_PRIVATE(upb_GeneratedExtensionListEntry)* UPB_PRIVATE(upb_generated_extension_list);
typedef struct {
upb_MiniTableField fields[5];
} Tool_msg_init_Fields;
static const Tool_msg_init_Fields Tool__fields = {{
{1, 16, 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(24, 32), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(32, 48), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{4, 8, 0, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{5, 12, 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
}};
const upb_MiniTable Tool_msg_init = {
NULL,
&Tool__fields[0],
UPB_SIZE(40, 64), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(255), 0,
&Tool__fields.fields[0],
UPB_SIZE(40, 64), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0,
#ifdef UPB_TRACING_ENABLED
"Tool",
#endif
UPB_FASTTABLE_INIT({
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x001000003f00000a, &upb_DecodeFast_String_Scalar_Tag1Byte},
{0x002000003f000012, &upb_DecodeFast_String_Scalar_Tag1Byte},
{0x003000003f00001a, &upb_DecodeFast_Bytes_Scalar_Tag1Byte},
{0x000800003f000020, &upb_DecodeFast_Bool_Scalar_Tag1Byte},
{0x000c00003f000028, &upb_DecodeFast_Varint32_Scalar_Tag1Byte},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
})
};
const upb_MiniTable* Tool_msg_init_ptr = &Tool_msg_init;
static const upb_MiniTableField Connection__fields[5] = {
typedef struct {
upb_MiniTableField fields[5];
} Connection_msg_init_Fields;
static const Connection_msg_init_Fields Connection__fields = {{
{1, 16, 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, 12, 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{3, 8, 0, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{4, UPB_SIZE(32, 48), 0, kUpb_NoSub, 3, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
{5, UPB_SIZE(24, 32), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
}};
const upb_MiniTable Connection_msg_init = {
NULL,
&Connection__fields[0],
UPB_SIZE(40, 56), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(255), 0,
&Connection__fields.fields[0],
UPB_SIZE(40, 56), 5, kUpb_ExtMode_NonExtendable, 5, UPB_FASTTABLE_MASK(56), 0,
#ifdef UPB_TRACING_ENABLED
"Connection",
#endif
UPB_FASTTABLE_INIT({
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x001000003f00000a, &upb_DecodeFast_String_Scalar_Tag1Byte},
{0x000c00003f000010, &upb_DecodeFast_Varint32_Scalar_Tag1Byte},
{0x000800003f000018, &upb_DecodeFast_Bool_Scalar_Tag1Byte},
{0x003000003f000020, &upb_DecodeFast_Varint64_Scalar_Tag1Byte},
{0x002000003f00002a, &upb_DecodeFast_Bytes_Scalar_Tag1Byte},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
})
};
const upb_MiniTable* Connection_msg_init_ptr = &Connection_msg_init;
static const upb_MiniTableSubInternal Hacker__submsgs[2] = {
{.UPB_PRIVATE(submsg) = &Tool_msg_init_ptr},
{.UPB_PRIVATE(submsg) = &Connection_msg_init_ptr},
};
typedef struct {
upb_MiniTableField fields[9];
upb_MiniTableSubInternal subs[2];
} Hacker_msg_init_Fields;
static const upb_MiniTableField Hacker__fields[9] = {
static const Hacker_msg_init_Fields Hacker__fields = {{
{1, UPB_SIZE(32, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, 40, 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{3, 12, 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
@@ -63,96 +87,138 @@ static const upb_MiniTableField Hacker__fields[9] = {
{5, 9, 0, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{6, UPB_SIZE(48, 56), 0, kUpb_NoSub, 3, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
{7, UPB_SIZE(20, 64), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
{8, UPB_SIZE(24, 72), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
{9, UPB_SIZE(28, 80), 64, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
};
{8, UPB_SIZE(24, 72), 0, UPB_SIZE(6, 7), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
{9, UPB_SIZE(28, 80), 64, UPB_SIZE(4, 6), 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
},
{
{.UPB_PRIVATE(submsg) = &Tool_msg_init},
{.UPB_PRIVATE(submsg) = &Connection_msg_init},
}};
const upb_MiniTable Hacker_msg_init = {
&Hacker__submsgs[0],
&Hacker__fields[0],
&Hacker__fields.fields[0],
UPB_SIZE(56, 88), 9, kUpb_ExtMode_NonExtendable, 9, UPB_FASTTABLE_MASK(56), 0,
#ifdef UPB_TRACING_ENABLED
"Hacker",
#endif
UPB_FASTTABLE_INIT({
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x001800003f00000a, &upb_DecodeFast_String_Scalar_Tag1Byte},
{0x002800003f000012, &upb_DecodeFast_String_Scalar_Tag1Byte},
{0x000c00003f000018, &upb_DecodeFast_Varint32_Scalar_Tag1Byte},
{0x001000003f000025, &upb_DecodeFast_Fixed32_Scalar_Tag1Byte},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x000900003f000028, &upb_DecodeFast_Bool_Scalar_Tag1Byte},
{0x003800003f000030, &upb_DecodeFast_Varint64_Scalar_Tag1Byte},
{0x004000003f00003a, &upb_DecodeFast_String_Repeated_Tag1Byte},
})
};
const upb_MiniTable* Hacker_msg_init_ptr = &Hacker_msg_init;
static const upb_MiniTableField Worm__fields[6] = {
typedef struct {
upb_MiniTableField fields[6];
} Worm_msg_init_Fields;
static const Worm_msg_init_Fields Worm__fields = {{
{1, UPB_SIZE(20, 16), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, 12, 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(40, 48), 0, kUpb_NoSub, 3, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
{4, UPB_SIZE(28, 32), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{5, 8, 0, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{6, UPB_SIZE(16, 56), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
};
}};
const upb_MiniTable Worm_msg_init = {
NULL,
&Worm__fields[0],
UPB_SIZE(48, 64), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(255), 0,
&Worm__fields.fields[0],
UPB_SIZE(48, 64), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0,
#ifdef UPB_TRACING_ENABLED
"Worm",
#endif
UPB_FASTTABLE_INIT({
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x001000003f00000a, &upb_DecodeFast_String_Scalar_Tag1Byte},
{0x000c00003f000010, &upb_DecodeFast_Varint32_Scalar_Tag1Byte},
{0x003000003f000018, &upb_DecodeFast_Varint64_Scalar_Tag1Byte},
{0x002000003f000022, &upb_DecodeFast_Bytes_Scalar_Tag1Byte},
{0x000800003f000028, &upb_DecodeFast_Bool_Scalar_Tag1Byte},
{0x003800003f000032, &upb_DecodeFast_String_Repeated_Tag1Byte},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
})
};
const upb_MiniTable* Worm_msg_init_ptr = &Worm_msg_init;
static const upb_MiniTableSubInternal Operation__submsgs[2] = {
{.UPB_PRIVATE(submsg) = &Hacker_msg_init_ptr},
{.UPB_PRIVATE(submsg) = &Worm_msg_init_ptr},
};
typedef struct {
upb_MiniTableField fields[9];
upb_MiniTableSubInternal subs[2];
} Operation_msg_init_Fields;
static const upb_MiniTableField Operation__fields[9] = {
static const Operation_msg_init_Fields Operation__fields = {{
{1, UPB_SIZE(28, 16), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(36, 32), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(56, 64), 0, kUpb_NoSub, 3, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
{4, 9, 0, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
{5, UPB_SIZE(44, 48), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{6, UPB_SIZE(12, 72), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
{7, UPB_SIZE(16, 80), 64, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
{6, UPB_SIZE(12, 72), 0, UPB_SIZE(12, 13), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
{7, UPB_SIZE(16, 80), 64, UPB_SIZE(10, 12), 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
{8, UPB_SIZE(20, 88), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
{9, UPB_SIZE(24, 12), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
},
{
{.UPB_PRIVATE(submsg) = &Hacker_msg_init},
{.UPB_PRIVATE(submsg) = &Worm_msg_init},
}};
const upb_MiniTable Operation_msg_init = {
&Operation__submsgs[0],
&Operation__fields[0],
UPB_SIZE(64, 96), 9, kUpb_ExtMode_NonExtendable, 9, UPB_FASTTABLE_MASK(255), 0,
&Operation__fields.fields[0],
UPB_SIZE(64, 96), 9, kUpb_ExtMode_NonExtendable, 9, UPB_FASTTABLE_MASK(120), 0,
#ifdef UPB_TRACING_ENABLED
"Operation",
#endif
UPB_FASTTABLE_INIT({
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x001000003f00000a, &upb_DecodeFast_String_Scalar_Tag1Byte},
{0x002000003f000012, &upb_DecodeFast_String_Scalar_Tag1Byte},
{0x004000003f000018, &upb_DecodeFast_Varint64_Scalar_Tag1Byte},
{0x000900003f000020, &upb_DecodeFast_Bool_Scalar_Tag1Byte},
{0x003000003f00002a, &upb_DecodeFast_Bytes_Scalar_Tag1Byte},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x005800003f000042, &upb_DecodeFast_String_Repeated_Tag1Byte},
{0x000c00003f000048, &upb_DecodeFast_Varint32_Scalar_Tag1Byte},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
})
};
const upb_MiniTable* Operation_msg_init_ptr = &Operation_msg_init;
static const upb_MiniTableSubInternal Campaign__submsgs[1] = {
{.UPB_PRIVATE(submsg) = &Operation_msg_init_ptr},
};
typedef struct {
upb_MiniTableField fields[3];
upb_MiniTableSubInternal subs[1];
} Campaign_msg_init_Fields;
static const upb_MiniTableField Campaign__fields[3] = {
static const Campaign_msg_init_Fields Campaign__fields = {{
{1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(8, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(8, 24), 0, UPB_SIZE(6, 7), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(24, 32), 0, kUpb_NoSub, 3, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
};
},
{
{.UPB_PRIVATE(submsg) = &Operation_msg_init},
}};
const upb_MiniTable Campaign_msg_init = {
&Campaign__submsgs[0],
&Campaign__fields[0],
UPB_SIZE(32, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(255), 0,
&Campaign__fields.fields[0],
UPB_SIZE(32, 40), 3, kUpb_ExtMode_NonExtendable, 3, UPB_FASTTABLE_MASK(24), 0,
#ifdef UPB_TRACING_ENABLED
"Campaign",
#endif
UPB_FASTTABLE_INIT({
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x000800003f00000a, &upb_DecodeFast_String_Scalar_Tag1Byte},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x002000003f000018, &upb_DecodeFast_Varint64_Scalar_Tag1Byte},
})
};
const upb_MiniTable* Campaign_msg_init_ptr = &Campaign_msg_init;
static const upb_MiniTable *messages_layout[6] = {
&Tool_msg_init,
&Connection_msg_init,