Skip to content

Serialise explicitly typed JSON-LD literals in canonical lexical form#2628

Merged
jviotti merged 3 commits into
mainfrom
jsonld-serialise
Jul 17, 2026
Merged

Serialise explicitly typed JSON-LD literals in canonical lexical form#2628
jviotti merged 3 commits into
mainfrom
jsonld-serialise

Conversation

@jviotti

@jviotti jviotti commented Jul 17, 2026

Copy link
Copy Markdown
Member

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Review in cubic

@augmentcode

augmentcode Bot commented Jul 17, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR changes JSON-LD materialization so that explicitly-typed literals are serialized using canonical RDF lexical forms, instead of emitting native JSON numbers/booleans.

Changes:

  • Introduced jsonld_serialise.h with helpers to compute canonical lexical forms for typed literals (notably canonical scientific form for xsd:double/xsd:float, and exponent-free fixed forms for decimal-like cases).
  • Updated jsonld_materialize.cc to rewrite @value into a string lexical form whenever a literal carries an explicit @type (while preserving @json literals verbatim).
  • Documented the behavior in JSONLDLiteral comments to clarify that explicit datatypes imply canonical lexical strings for native numbers/booleans.
  • Fixed BigCoefficient::strip_trailing_zeros() to correctly divide multi-word coefficients by 10 with remainder propagation across words.
  • Updated and greatly expanded JSON-LD materialization tests to cover many numeric/boolean/datatype combinations and edge magnitudes.
  • Added targeted decimal reduction tests to prevent regressions in big/heap coefficient trailing-zero stripping.

Technical Notes: The new serialization logic aims to keep typed literals well-formed with respect to datatype lexical spaces (e.g., avoiding scientific notation for exponent-free datatypes like xsd:decimal) while matching JSON-LD/RDF canonicalization rules where applicable.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread src/core/jsonld/jsonld_serialise.h

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (windows/msvc)

Details
Benchmark suite Current: 97cfff2 Previous: 966869b Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 5.401923000001715 ns/iter 5.020503571428899 ns/iter 1.08
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 5.024689285714804 ns/iter 4.960992999999689 ns/iter 1.01
Regex_Period_Asterisk 5.021692000000257 ns/iter 4.954082142857276 ns/iter 1.01
Regex_Group_Period_Asterisk_Group 5.028929000000062 ns/iter 4.959664285713927 ns/iter 1.01
Regex_Period_Plus 5.037714000000051 ns/iter 5.441138999999566 ns/iter 0.93
Regex_Period 5.3447330357150635 ns/iter 5.498776785714198 ns/iter 0.97
Regex_Caret_Period_Plus_Dollar 5.026973999999882 ns/iter 5.716585999999779 ns/iter 0.88
Regex_Caret_Group_Period_Plus_Group_Dollar 5.345760714285624 ns/iter 4.6512594975076835 ns/iter 1.15
Regex_Caret_Period_Asterisk_Dollar 5.3299809999998615 ns/iter 5.022242000000006 ns/iter 1.06
Regex_Caret_Group_Period_Asterisk_Group_Dollar 5.059495535714323 ns/iter 4.977627999999186 ns/iter 1.02
Regex_Caret_X_Hyphen 8.480305803570635 ns/iter 7.9079508928574835 ns/iter 1.07
Regex_Period_Md_Dollar 45.107787500000995 ns/iter 57.428383928562916 ns/iter 0.79
Regex_Caret_Slash_Period_Asterisk 7.9823906249996766 ns/iter 7.5300424107143415 ns/iter 1.06
Regex_Caret_Period_Range_Dollar 5.985615178571736 ns/iter 5.544351999999435 ns/iter 1.08
Regex_Nested_Backtrack 55.54749999998876 ns/iter 77.57118303571683 ns/iter 0.72
JSON_Array_Of_Objects_Unique 609.202946428411 ns/iter 648.4866071428793 ns/iter 0.94
JSON_Parse_1 8883.995607161884 ns/iter 9261.712670926008 ns/iter 0.96
JSON_Parse_Real 16159.991071426866 ns/iter 16762.624303286597 ns/iter 0.96
JSON_Parse_Decimal 11748.432142858128 ns/iter 11431.021428571901 ns/iter 1.03
JSON_Parse_Schema_ISO_Language 7744541.964285645 ns/iter 8212430.666665872 ns/iter 0.94
JSON_Parse_Integer 6103.918750000048 ns/iter 5887.077678571423 ns/iter 1.04
JSON_Parse_String_NonSSO_Plain 7790.962053572262 ns/iter 7751.257812500205 ns/iter 1.01
JSON_Parse_String_SSO_Plain 3707.8928859295384 ns/iter 3608.4766124353564 ns/iter 1.03
JSON_Parse_String_Escape_Heavy 21734.89062500522 ns/iter 21712.931250000624 ns/iter 1.00
JSON_Parse_Object_Short_Keys 13205.50535714509 ns/iter 12907.028571427354 ns/iter 1.02
JSON_Parse_Object_Scalar_Properties 6823.900669642922 ns/iter 6715.035714285429 ns/iter 1.02
JSON_Parse_Object_Array_Properties 11299.360937499614 ns/iter 11510.589062501353 ns/iter 0.98
JSON_Parse_Object_Object_Properties 11441.949999998258 ns/iter 11692.845312499145 ns/iter 0.98
JSON_Parse_Nested_Containers 78832.46651788156 ns/iter 81574.09598213507 ns/iter 0.97
JSON_From_String_Copy 64.2302410714178 ns/iter 66.5440892857256 ns/iter 0.97
JSON_From_String_Temporary 58.09899999998639 ns/iter 89.64957589286473 ns/iter 0.65
JSON_Number_To_Double 124.96394642856298 ns/iter 132.82076785714025 ns/iter 0.94
JSON_Object_At_Last_Key/8 7.281933035714974 ns/iter 7.613120535714708 ns/iter 0.96
JSON_Object_At_Last_Key/32 23.379378087282397 ns/iter 24.73047963470368 ns/iter 0.95
JSON_Object_At_Last_Key/128 89.30321922752822 ns/iter 98.81088844593036 ns/iter 0.90
JSON_Object_At_Last_Key/512 426.30638134251575 ns/iter 428.81888843164114 ns/iter 0.99
JSON_Fast_Hash_Helm_Chart_Lock 111.94256249996924 ns/iter 124.36704687502242 ns/iter 0.90
JSON_Equality_Helm_Chart_Lock 209.9789794651961 ns/iter 208.0956625850112 ns/iter 1.01
JSON_Divisible_By_Decimal 294.76236184092613 ns/iter 357.677328467635 ns/iter 0.82
JSON_String_Equal/10 10.68385781250214 ns/iter 9.98385624999898 ns/iter 1.07
JSON_String_Equal/100 12.462058928572821 ns/iter 11.347940625000774 ns/iter 1.10
JSON_String_Equal_Small_By_Perfect_Hash/10 2.526283928571209 ns/iter 2.175646609085869 ns/iter 1.16
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 15.048387656033153 ns/iter 15.849114438176475 ns/iter 0.95
JSON_String_Fast_Hash/10 6.614150892856077 ns/iter 6.3933625000000145 ns/iter 1.03
JSON_String_Fast_Hash/100 6.655131250001643 ns/iter 6.399595535713486 ns/iter 1.04
JSON_String_Key_Hash/10 5.357822321428785 ns/iter 4.956712999999127 ns/iter 1.08
JSON_String_Key_Hash/100 11.889962500000756 ns/iter 10.98787812500035 ns/iter 1.08
JSON_Object_Defines_Miss_Same_Length 3.787253028952106 ns/iter 3.8900982142856373 ns/iter 0.97
JSON_Object_Defines_Miss_Too_Small 4.093228926744458 ns/iter 4.347173125000836 ns/iter 0.94
JSON_Object_Defines_Miss_Too_Large 3.7876853503793617 ns/iter 3.8932499999993246 ns/iter 0.97
Pointer_Object_Traverse 71.28290178570751 ns/iter 76.5148214285765 ns/iter 0.93
Pointer_Object_Try_Traverse 71.14044642855889 ns/iter 69.96341517856916 ns/iter 1.02
Pointer_Push_Back_Pointer_To_Weak_Pointer 167.65863839286308 ns/iter 162.73403545089172 ns/iter 1.03
Pointer_Walker_Schema_ISO_Language 13241184.375001324 ns/iter 13076626.000001853 ns/iter 1.01
Pointer_Maybe_Tracked_Deeply_Nested/0 2451733.3333337223 ns/iter 2449303.614457859 ns/iter 1.00
Pointer_Maybe_Tracked_Deeply_Nested/1 3767164.171122544 ns/iter 3664071.1229950134 ns/iter 1.03
Pointer_Position_Tracker_Get_Deeply_Nested 551.5338169642193 ns/iter 538.0003320810969 ns/iter 1.03
JSONPath_Descendant_Filter_Nested 2364.2009328115864 ns/iter 2600.8982142855075 ns/iter 0.91
URITemplateRouter_Create 41079.14180678494 ns/iter 39755.000000000044 ns/iter 1.03
URITemplateRouter_Match 233.87193818389608 ns/iter 216.02345687395123 ns/iter 1.08
URITemplateRouter_Match_BasePath 264.41064285709865 ns/iter 244.86857758165792 ns/iter 1.08
URITemplateRouterView_Restore 32312.340404638133 ns/iter 24930.37499999673 ns/iter 1.30
URITemplateRouterView_Match 181.60991394712335 ns/iter 170.61406276433314 ns/iter 1.06
URITemplateRouterView_Match_BasePath 206.86257781858393 ns/iter 195.01212455465313 ns/iter 1.06
URITemplateRouterView_Arguments 532.131900000195 ns/iter 604.857053571298 ns/iter 0.88
JSONL_Parse_Large 32793814.28571815 ns/iter 32671923.80952197 ns/iter 1.00
JSONL_Parse_Large_GZIP 33414414.285711505 ns/iter 33202274.99999646 ns/iter 1.01
JSONLD_Catalog_Annotation_List_Populate 2793471.0843377085 ns/iter 2915260.642570516 ns/iter 0.96
JSONLD_Catalog_Materialize 8033833.333332849 ns/iter 10037987.499998735 ns/iter 0.80
HTML_Build_Table_100000 90134471.4285902 ns/iter 91648477.77777949 ns/iter 0.98
HTML_Render_Table_100000 8002738.8888866985 ns/iter 8281518.666666064 ns/iter 0.97
GZIP_Compress_ISO_Language_Set_3_Locations 36418347.36842946 ns/iter 38022999.99999473 ns/iter 0.96
GZIP_Decompress_ISO_Language_Set_3_Locations 10269110.666664952 ns/iter 11180464.062498175 ns/iter 0.92
GZIP_Compress_ISO_Language_Set_3_Schema 2121880.9375000093 ns/iter 2287939.130434876 ns/iter 0.93
GZIP_Decompress_ISO_Language_Set_3_Schema 657200.2678571006 ns/iter 581046.0714284561 ns/iter 1.13
JOSE_VerifySignature_RS256 21282.559375002562 ns/iter 23733.585562664317 ns/iter 0.90
JOSE_VerifySignature_ES512 1535396.3855423864 ns/iter 1531734.337349296 ns/iter 1.00

This comment was automatically generated by workflow using github-action-benchmark.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment thread src/core/jsonld/jsonld_serialise.h
Comment thread src/core/jsonld/jsonld_serialise.h
Comment thread src/core/jsonld/jsonld_materialize.cc

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (macos/llvm)

Details
Benchmark suite Current: 97cfff2 Previous: 966869b Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.8021133437734027 ns/iter 2.275773052273508 ns/iter 0.79
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.9064143782580287 ns/iter 1.8190650648620734 ns/iter 1.05
Regex_Period_Asterisk 1.7959671620760105 ns/iter 1.723424236745136 ns/iter 1.04
Regex_Group_Period_Asterisk_Group 1.8045691737822984 ns/iter 1.703874017334451 ns/iter 1.06
Regex_Period_Plus 2.0461110631225847 ns/iter 2.3109933639163183 ns/iter 0.89
Regex_Period 2.1644838193260227 ns/iter 2.37549200201673 ns/iter 0.91
Regex_Caret_Period_Plus_Dollar 2.155129738220676 ns/iter 3.370437486496658 ns/iter 0.64
Regex_Caret_Group_Period_Plus_Group_Dollar 2.061552181839035 ns/iter 2.821106426911061 ns/iter 0.73
Regex_Caret_Period_Asterisk_Dollar 1.7678499327582353 ns/iter 2.2402348062688797 ns/iter 0.79
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.265193350372763 ns/iter 2.1987155821452657 ns/iter 1.03
Regex_Caret_X_Hyphen 9.536588769729194 ns/iter 7.443048654362473 ns/iter 1.28
Regex_Period_Md_Dollar 19.09192323408889 ns/iter 23.57711466597133 ns/iter 0.81
Regex_Caret_Slash_Period_Asterisk 5.440874579999218 ns/iter 6.291157961406636 ns/iter 0.86
Regex_Caret_Period_Range_Dollar 2.3388567356876058 ns/iter 2.714178166903204 ns/iter 0.86
Regex_Nested_Backtrack 29.30624605033234 ns/iter 30.592390094828232 ns/iter 0.96
JSON_Array_Of_Objects_Unique 356.92399725385116 ns/iter 424.2983851910939 ns/iter 0.84
JSON_Parse_1 6933.468934393936 ns/iter 11220.369919990062 ns/iter 0.62
JSON_Parse_Real 8032.184925568262 ns/iter 11880.715661103359 ns/iter 0.68
JSON_Parse_Decimal 8008.63387361662 ns/iter 10052.03173864084 ns/iter 0.80
JSON_Parse_Schema_ISO_Language 4021628.4530384974 ns/iter 4312869.890322286 ns/iter 0.93
JSON_Parse_Integer 5573.863716783265 ns/iter 4747.017120779974 ns/iter 1.17
JSON_Parse_String_NonSSO_Plain 7609.239108139085 ns/iter 8048.542765627465 ns/iter 0.95
JSON_Parse_String_SSO_Plain 3104.9915183684216 ns/iter 3910.9169302092573 ns/iter 0.79
JSON_Parse_String_Escape_Heavy 22739.687015102878 ns/iter 24810.665854191015 ns/iter 0.92
JSON_Parse_Object_Short_Keys 8810.791704249645 ns/iter 8938.991061395964 ns/iter 0.99
JSON_Parse_Object_Scalar_Properties 4599.3319202609355 ns/iter 5098.744836352528 ns/iter 0.90
JSON_Parse_Object_Array_Properties 7250.601236012857 ns/iter 9839.675772589015 ns/iter 0.74
JSON_Parse_Object_Object_Properties 7364.981285717396 ns/iter 11378.83333135295 ns/iter 0.65
JSON_Parse_Nested_Containers 60324.531186266315 ns/iter 102000.1628876794 ns/iter 0.59
JSON_From_String_Copy 24.36490425470534 ns/iter 42.2461140481483 ns/iter 0.58
JSON_From_String_Temporary 19.307062715645436 ns/iter 32.66700220552635 ns/iter 0.59
JSON_Number_To_Double 38.37894927343732 ns/iter 48.48984883983602 ns/iter 0.79
JSON_Object_At_Last_Key/8 3.980816083961703 ns/iter 5.3423230131546156 ns/iter 0.75
JSON_Object_At_Last_Key/32 12.416431049135117 ns/iter 17.21720147623178 ns/iter 0.72
JSON_Object_At_Last_Key/128 59.31915888083261 ns/iter 80.44599962849489 ns/iter 0.74
JSON_Object_At_Last_Key/512 201.40498021738895 ns/iter 241.57096903125606 ns/iter 0.83
JSON_Fast_Hash_Helm_Chart_Lock 60.07374785244477 ns/iter 79.16732585899629 ns/iter 0.76
JSON_Equality_Helm_Chart_Lock 144.25464871660762 ns/iter 212.19643341784712 ns/iter 0.68
JSON_Divisible_By_Decimal 184.5134224600501 ns/iter 232.8605987096831 ns/iter 0.79
JSON_String_Equal/10 7.055256153875126 ns/iter 8.649630582472591 ns/iter 0.82
JSON_String_Equal/100 6.649062734032013 ns/iter 7.228347907385374 ns/iter 0.92
JSON_String_Equal_Small_By_Perfect_Hash/10 0.3625310137839238 ns/iter 0.4029327292694728 ns/iter 0.90
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.34115140088758 ns/iter 3.6884027294733115 ns/iter 0.91
JSON_String_Fast_Hash/10 2.5073850232074553 ns/iter 2.8165791980821018 ns/iter 0.89
JSON_String_Fast_Hash/100 2.122351306460175 ns/iter 2.890430967043733 ns/iter 0.73
JSON_String_Key_Hash/10 1.812347056672038 ns/iter 2.133738024757339 ns/iter 0.85
JSON_String_Key_Hash/100 2.4354917712002924 ns/iter 2.3406180195124504 ns/iter 1.04
JSON_Object_Defines_Miss_Same_Length 2.9103965642048837 ns/iter 2.8713352907619845 ns/iter 1.01
JSON_Object_Defines_Miss_Too_Small 2.77018315997723 ns/iter 2.7836706502522444 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 2.640369823712912 ns/iter 3.0047399060766966 ns/iter 0.88
Pointer_Object_Traverse 23.595435755241397 ns/iter 23.61078725461542 ns/iter 1.00
Pointer_Object_Try_Traverse 23.86829296361318 ns/iter 22.66233245784944 ns/iter 1.05
Pointer_Push_Back_Pointer_To_Weak_Pointer 170.72288352592227 ns/iter 213.84555310650595 ns/iter 0.80
Pointer_Walker_Schema_ISO_Language 2584642.5276752957 ns/iter 3096162.147783038 ns/iter 0.83
Pointer_Maybe_Tracked_Deeply_Nested/0 1187392.7734513043 ns/iter 1492479.1257606696 ns/iter 0.80
Pointer_Maybe_Tracked_Deeply_Nested/1 994066.8622589918 ns/iter 1295919.702325704 ns/iter 0.77
Pointer_Position_Tracker_Get_Deeply_Nested 337.02697375030976 ns/iter 370.7446751827866 ns/iter 0.91
JSONPath_Descendant_Filter_Nested 1237.6689097136582 ns/iter 1352.2540414717885 ns/iter 0.92
URITemplateRouter_Create 23678.550480770642 ns/iter 25349.38909104602 ns/iter 0.93
URITemplateRouter_Match 165.96439112564073 ns/iter 181.92232724021255 ns/iter 0.91
URITemplateRouter_Match_BasePath 194.10186106367152 ns/iter 219.16687693924942 ns/iter 0.89
URITemplateRouterView_Restore 10349.78339648241 ns/iter 12860.603517686046 ns/iter 0.80
URITemplateRouterView_Match 135.45714932770065 ns/iter 154.6187459916186 ns/iter 0.88
URITemplateRouterView_Match_BasePath 158.91473147881607 ns/iter 171.85447985552824 ns/iter 0.92
URITemplateRouterView_Arguments 553.4657258973199 ns/iter 629.7665452603934 ns/iter 0.88
JSONL_Parse_Large 10011469.042857308 ns/iter 11954983.745762533 ns/iter 0.84
JSONL_Parse_Large_GZIP 11413356.310346648 ns/iter 12800829.967741925 ns/iter 0.89
JSONLD_Catalog_Annotation_List_Populate 876216.1392404537 ns/iter 961726.1641104099 ns/iter 0.91
JSONLD_Catalog_Materialize 4264434.451219653 ns/iter 4759623.308942773 ns/iter 0.90
HTML_Build_Table_100000 36443782.89473742 ns/iter 44758847.22222645 ns/iter 0.81
HTML_Render_Table_100000 1695200.0827068742 ns/iter 1826600.7542372579 ns/iter 0.93
GZIP_Compress_ISO_Language_Set_3_Locations 27033780.85185351 ns/iter 27639240.545454416 ns/iter 0.98
GZIP_Decompress_ISO_Language_Set_3_Locations 3142785.1963469316 ns/iter 3499148.5507243457 ns/iter 0.90
GZIP_Compress_ISO_Language_Set_3_Schema 1490444.1268190984 ns/iter 1578963.0391703334 ns/iter 0.94
GZIP_Decompress_ISO_Language_Set_3_Schema 273862.05011654284 ns/iter 290164.14101465064 ns/iter 0.94
JOSE_VerifySignature_RS256 20758.703994819993 ns/iter 36747.19690944665 ns/iter 0.56
JOSE_VerifySignature_ES512 1130289.4697675668 ns/iter 1472705.755376378 ns/iter 0.77

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (linux/llvm)

Details
Benchmark suite Current: 97cfff2 Previous: 966869b Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.1908328296821966 ns/iter 2.214986323597745 ns/iter 0.99
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.1903909920798115 ns/iter 2.1915788326695176 ns/iter 1.00
Regex_Period_Asterisk 2.181940282503226 ns/iter 2.1885377054278505 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 2.181458093701883 ns/iter 2.1846101175218204 ns/iter 1.00
Regex_Period_Plus 2.8084180628458983 ns/iter 2.8013260245631857 ns/iter 1.00
Regex_Period 3.116013938579629 ns/iter 2.8319202863266772 ns/iter 1.10
Regex_Caret_Period_Plus_Dollar 3.119824214717555 ns/iter 2.2232501429094085 ns/iter 1.40
Regex_Caret_Group_Period_Plus_Group_Dollar 2.8022413187775994 ns/iter 2.2282431502986166 ns/iter 1.26
Regex_Caret_Period_Asterisk_Dollar 3.1112944251379626 ns/iter 2.4913299046760375 ns/iter 1.25
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.4239141335490166 ns/iter 2.4904271160593976 ns/iter 1.37
Regex_Caret_X_Hyphen 6.856902639453747 ns/iter 6.542240319419182 ns/iter 1.05
Regex_Period_Md_Dollar 27.60662008445316 ns/iter 27.28474068503849 ns/iter 1.01
Regex_Caret_Slash_Period_Asterisk 6.852907363545334 ns/iter 7.1678315742231105 ns/iter 0.96
Regex_Caret_Period_Range_Dollar 4.044936295057512 ns/iter 4.358675231526067 ns/iter 0.93
Regex_Nested_Backtrack 38.45853614249913 ns/iter 38.073296401810005 ns/iter 1.01
JSON_Array_Of_Objects_Unique 409.1137414485267 ns/iter 458.78121807167264 ns/iter 0.89
JSON_Parse_1 4855.6402832741205 ns/iter 4840.198540791036 ns/iter 1.00
JSON_Parse_Real 5445.380957555515 ns/iter 5339.247645038777 ns/iter 1.02
JSON_Parse_Decimal 7765.950140871155 ns/iter 7629.509948110839 ns/iter 1.02
JSON_Parse_Schema_ISO_Language 3454289.4900993705 ns/iter 3450848.1871920493 ns/iter 1.00
JSON_Parse_Integer 3847.5092367580414 ns/iter 3890.180960954436 ns/iter 0.99
JSON_Parse_String_NonSSO_Plain 5005.326058684927 ns/iter 4928.478793259119 ns/iter 1.02
JSON_Parse_String_SSO_Plain 2759.7401281210628 ns/iter 2692.6419882909654 ns/iter 1.02
JSON_Parse_String_Escape_Heavy 14068.171142331907 ns/iter 14155.729100572125 ns/iter 0.99
JSON_Parse_Object_Short_Keys 7862.17812900462 ns/iter 10361.259436752378 ns/iter 0.76
JSON_Parse_Object_Scalar_Properties 4061.6830682270174 ns/iter 4137.994066365405 ns/iter 0.98
JSON_Parse_Object_Array_Properties 5641.739414704577 ns/iter 5411.02986007719 ns/iter 1.04
JSON_Parse_Object_Object_Properties 5644.905452230238 ns/iter 5342.403629823224 ns/iter 1.06
JSON_Parse_Nested_Containers 46018.48925967625 ns/iter 44726.542822370415 ns/iter 1.03
JSON_From_String_Copy 19.940237551419838 ns/iter 19.359948051040966 ns/iter 1.03
JSON_From_String_Temporary 17.45866431320211 ns/iter 17.444863681867535 ns/iter 1.00
JSON_Number_To_Double 23.052698217962742 ns/iter 23.709097214038934 ns/iter 0.97
JSON_Object_At_Last_Key/8 3.829684339599927 ns/iter 5.918459892040408 ns/iter 0.65
JSON_Object_At_Last_Key/32 12.385457298273934 ns/iter 21.800494309589894 ns/iter 0.57
JSON_Object_At_Last_Key/128 56.89135816705852 ns/iter 87.89123447649993 ns/iter 0.65
JSON_Object_At_Last_Key/512 399.4860544563164 ns/iter 404.44935324921164 ns/iter 0.99
JSON_Fast_Hash_Helm_Chart_Lock 60.726646248358435 ns/iter 56.62761619267085 ns/iter 1.07
JSON_Equality_Helm_Chart_Lock 158.62202186519906 ns/iter 154.5296245970208 ns/iter 1.03
JSON_Divisible_By_Decimal 259.82817377248784 ns/iter 254.51287473398014 ns/iter 1.02
JSON_String_Equal/10 5.918402094430123 ns/iter 5.922801971350426 ns/iter 1.00
JSON_String_Equal/100 6.54660624188585 ns/iter 6.548685496941712 ns/iter 1.00
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9437106205319586 ns/iter 0.9353587361713253 ns/iter 1.01
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 21.794874480941104 ns/iter 10.482162693476138 ns/iter 2.08
JSON_String_Fast_Hash/10 2.8031962820636225 ns/iter 2.184470345195639 ns/iter 1.28
JSON_String_Fast_Hash/100 2.8021451087486673 ns/iter 2.1797816963104895 ns/iter 1.29
JSON_String_Key_Hash/10 2.250409952784613 ns/iter 2.4956941325100765 ns/iter 0.90
JSON_String_Key_Hash/100 9.338533947059629 ns/iter 6.563576542534091 ns/iter 1.42
JSON_Object_Defines_Miss_Same_Length 2.9974569807814935 ns/iter 2.6972017687621364 ns/iter 1.11
JSON_Object_Defines_Miss_Too_Small 3.4288758526931096 ns/iter 2.6818120403861743 ns/iter 1.28
JSON_Object_Defines_Miss_Too_Large 2.6363829914414136 ns/iter 3.1953411463674986 ns/iter 0.83
Pointer_Object_Traverse 28.557144343363152 ns/iter 28.742522110845112 ns/iter 0.99
Pointer_Object_Try_Traverse 31.020646912279442 ns/iter 30.998772774405904 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 188.5920364720874 ns/iter 162.4598397661665 ns/iter 1.16
Pointer_Walker_Schema_ISO_Language 2628310.112782015 ns/iter 2662442.5209124796 ns/iter 0.99
Pointer_Maybe_Tracked_Deeply_Nested/0 1248975.1602915416 ns/iter 1209021.7001733347 ns/iter 1.03
Pointer_Maybe_Tracked_Deeply_Nested/1 1624444.4350799425 ns/iter 1588101.9409091964 ns/iter 1.02
Pointer_Position_Tracker_Get_Deeply_Nested 685.4186213147101 ns/iter 690.2992960060777 ns/iter 0.99
JSONPath_Descendant_Filter_Nested 1609.773880174446 ns/iter 1616.272181744328 ns/iter 1.00
URITemplateRouter_Create 31479.436559041205 ns/iter 32028.660464902932 ns/iter 0.98
URITemplateRouter_Match 176.09045010773306 ns/iter 173.02431105585114 ns/iter 1.02
URITemplateRouter_Match_BasePath 204.8138490885484 ns/iter 198.93231756203176 ns/iter 1.03
URITemplateRouterView_Restore 8273.11268285451 ns/iter 8439.35763888938 ns/iter 0.98
URITemplateRouterView_Match 145.36131294221912 ns/iter 146.27079663283666 ns/iter 0.99
URITemplateRouterView_Match_BasePath 165.078334454545 ns/iter 164.83585925340327 ns/iter 1.00
URITemplateRouterView_Arguments 438.1438691903238 ns/iter 428.88895835709343 ns/iter 1.02
JSONL_Parse_Large 9680268.424657797 ns/iter 9845602.028168337 ns/iter 0.98
JSONL_Parse_Large_GZIP 11253272.88709851 ns/iter 11525800.344263755 ns/iter 0.98
JSONLD_Catalog_Annotation_List_Populate 1227284.0964911077 ns/iter 1254835.4586330606 ns/iter 0.98
JSONLD_Catalog_Materialize 4195363.532933774 ns/iter 4166132.329341799 ns/iter 1.01
HTML_Build_Table_100000 71415799.19999686 ns/iter 68218695.09999487 ns/iter 1.05
HTML_Render_Table_100000 5413202.429688013 ns/iter 5291064.952755761 ns/iter 1.02
GZIP_Compress_ISO_Language_Set_3_Locations 32780192.380955882 ns/iter 33533124.8571449 ns/iter 0.98
GZIP_Decompress_ISO_Language_Set_3_Locations 4097042.2222220516 ns/iter 4301576.136646155 ns/iter 0.95
GZIP_Compress_ISO_Language_Set_3_Schema 1870909.70666668 ns/iter 1860346.9015958237 ns/iter 1.01
GZIP_Decompress_ISO_Language_Set_3_Schema 357220.26046985487 ns/iter 356484.16785352636 ns/iter 1.00
JOSE_VerifySignature_RS256 57998.697841729096 ns/iter 58196.343261353046 ns/iter 1.00
JOSE_VerifySignature_ES512 2368623.094594651 ns/iter 2360969.1486487584 ns/iter 1.00

This comment was automatically generated by workflow using github-action-benchmark.

jviotti added 3 commits July 17, 2026 11:00
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti
jviotti force-pushed the jsonld-serialise branch from 492e27a to 97cfff2 Compare July 17, 2026 14:00
@jviotti
jviotti merged commit 8fb5e8b into main Jul 17, 2026
12 checks passed
@jviotti
jviotti deleted the jsonld-serialise branch July 17, 2026 14:17

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (linux/gcc)

Details
Benchmark suite Current: 97cfff2 Previous: a9571a7 Ratio
JOSE_VerifySignature_RS256 22016.44154735693 ns/iter 21955.613229014103 ns/iter 1.00
JOSE_VerifySignature_ES512 575406.7368420236 ns/iter 488111.74494771136 ns/iter 1.18
GZIP_Compress_ISO_Language_Set_3_Locations 36317340.63157853 ns/iter 27421379.3846168 ns/iter 1.32
GZIP_Decompress_ISO_Language_Set_3_Locations 4295372.121951337 ns/iter 3625651.837695965 ns/iter 1.18
GZIP_Compress_ISO_Language_Set_3_Schema 2015490.317002966 ns/iter 1867230.2021563072 ns/iter 1.08
GZIP_Decompress_ISO_Language_Set_3_Schema 378884.1818181463 ns/iter 347940.6452416204 ns/iter 1.09
HTML_Build_Table_100000 61654012.27272841 ns/iter 52463969.23077484 ns/iter 1.18
HTML_Render_Table_100000 1939602.516759798 ns/iter 3233917.6132074096 ns/iter 0.60
JSONLD_Catalog_Annotation_List_Populate 1291624.1582866502 ns/iter 1188006.1423728536 ns/iter 1.09
JSONLD_Catalog_Materialize 6914550.656862209 ns/iter 6042756.999999576 ns/iter 1.14
JSONL_Parse_Large 14030721.980000181 ns/iter 12047299.137930559 ns/iter 1.16
JSONL_Parse_Large_GZIP 15330179.391303713 ns/iter 13317246.634613868 ns/iter 1.15
URITemplateRouter_Create 30064.140312473373 ns/iter 26826.05931129995 ns/iter 1.12
URITemplateRouter_Match 160.76155757734807 ns/iter 162.1266465667314 ns/iter 0.99
URITemplateRouter_Match_BasePath 185.5354924024353 ns/iter 182.24925280776975 ns/iter 1.02
URITemplateRouterView_Restore 8440.895802846 ns/iter 3491.67709464813 ns/iter 2.42
URITemplateRouterView_Match 124.77117412928864 ns/iter 118.06682445635082 ns/iter 1.06
URITemplateRouterView_Match_BasePath 142.0270766853633 ns/iter 136.30646767331442 ns/iter 1.04
URITemplateRouterView_Arguments 472.33537193180695 ns/iter 446.76049747981176 ns/iter 1.06
JSONPath_Descendant_Filter_Nested 1696.8692715709612 ns/iter 1350.8794790978723 ns/iter 1.26
Pointer_Object_Traverse 30.197729010756714 ns/iter 27.550498511249117 ns/iter 1.10
Pointer_Object_Try_Traverse 25.729857229346237 ns/iter 26.110309213426394 ns/iter 0.99
Pointer_Push_Back_Pointer_To_Weak_Pointer 157.2389244525913 ns/iter 145.5229563614323 ns/iter 1.08
Pointer_Walker_Schema_ISO_Language 2855650.0688258903 ns/iter 2539802.2310468648 ns/iter 1.12
Pointer_Maybe_Tracked_Deeply_Nested/0 1870243.8066296969 ns/iter 1921568.8246575852 ns/iter 0.97
Pointer_Maybe_Tracked_Deeply_Nested/1 1754956.762626438 ns/iter 1700348.8789347545 ns/iter 1.03
Pointer_Position_Tracker_Get_Deeply_Nested 398.4646630915531 ns/iter 466.57104913416913 ns/iter 0.85
JSON_Array_Of_Objects_Unique 427.61797966853317 ns/iter 399.7684390086788 ns/iter 1.07
JSON_Parse_1 10042.588022692544 ns/iter 8801.818148641594 ns/iter 1.14
JSON_Parse_Real 8091.6794679533305 ns/iter 6846.22661828391 ns/iter 1.18
JSON_Parse_Decimal 13011.244737788364 ns/iter 9742.406467924411 ns/iter 1.34
JSON_Parse_Schema_ISO_Language 6840789.165048326 ns/iter 6068027.905172357 ns/iter 1.13
JSON_Parse_Integer 5895.602724043269 ns/iter 4833.276110335978 ns/iter 1.22
JSON_Parse_String_NonSSO_Plain 12000.217202714357 ns/iter 10515.923331080032 ns/iter 1.14
JSON_Parse_String_SSO_Plain 5181.12255144857 ns/iter 4575.253430332173 ns/iter 1.13
JSON_Parse_String_Escape_Heavy 26024.472577898985 ns/iter 23635.35153778909 ns/iter 1.10
JSON_Parse_Object_Short_Keys 14150.111297004618 ns/iter 11935.778001796418 ns/iter 1.19
JSON_Parse_Object_Scalar_Properties 7131.502903897186 ns/iter 5942.245658431331 ns/iter 1.20
JSON_Parse_Object_Array_Properties 12671.829438279558 ns/iter 11124.017522668617 ns/iter 1.14
JSON_Parse_Object_Object_Properties 12543.505693282637 ns/iter 10945.361523493368 ns/iter 1.15
JSON_Parse_Nested_Containers 100399.96906188254 ns/iter 91163.8045654846 ns/iter 1.10
JSON_From_String_Copy 18.091187358403257 ns/iter 16.772913710232785 ns/iter 1.08
JSON_From_String_Temporary 15.398540600707033 ns/iter 14.547001041714973 ns/iter 1.06
JSON_Number_To_Double 22.13692046125517 ns/iter 22.70261533697758 ns/iter 0.98
JSON_Object_At_Last_Key/8 5.613605404507422 ns/iter 6.870533485643706 ns/iter 0.82
JSON_Object_At_Last_Key/32 21.964871225540357 ns/iter 21.668827048131657 ns/iter 1.01
JSON_Object_At_Last_Key/128 87.61224293725914 ns/iter 82.13146306227276 ns/iter 1.07
JSON_Object_At_Last_Key/512 401.7453822529603 ns/iter 263.7357221370856 ns/iter 1.52
JSON_Fast_Hash_Helm_Chart_Lock 62.27978529048457 ns/iter 72.44616785532885 ns/iter 0.86
JSON_Equality_Helm_Chart_Lock 160.5836467410945 ns/iter 131.2566573036399 ns/iter 1.22
JSON_Divisible_By_Decimal 253.1638779341358 ns/iter 235.85067999216795 ns/iter 1.07
JSON_String_Equal/10 5.419109368645965 ns/iter 5.036777677182547 ns/iter 1.08
JSON_String_Equal/100 6.044985883487388 ns/iter 6.336268476307233 ns/iter 0.95
JSON_String_Equal_Small_By_Perfect_Hash/10 0.7498272209018243 ns/iter 0.9348280120647967 ns/iter 0.80
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 25.19422595584676 ns/iter 17.22596975150443 ns/iter 1.46
JSON_String_Fast_Hash/10 2.2968252597084025 ns/iter 3.370710470687497 ns/iter 0.68
JSON_String_Fast_Hash/100 2.2971364913119396 ns/iter 3.376321724302036 ns/iter 0.68
JSON_String_Key_Hash/10 1.567551635078797 ns/iter 1.653204058762579 ns/iter 0.95
JSON_String_Key_Hash/100 12.44679074972439 ns/iter 13.024838400141594 ns/iter 0.96
JSON_Object_Defines_Miss_Same_Length 3.1176539784084216 ns/iter 2.935076676026481 ns/iter 1.06
JSON_Object_Defines_Miss_Too_Small 3.120447733838971 ns/iter 3.375724474026176 ns/iter 0.92
JSON_Object_Defines_Miss_Too_Large 3.1197979643912923 ns/iter 3.0286201037938865 ns/iter 1.03
Regex_Lower_S_Or_Upper_S_Asterisk 0.6251523171151674 ns/iter 0.9784669358980294 ns/iter 0.64
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 0.6229283993155946 ns/iter 0.9799188494548623 ns/iter 0.64
Regex_Period_Asterisk 0.6231369534188796 ns/iter 0.979314189562278 ns/iter 0.64
Regex_Group_Period_Asterisk_Group 0.622791596903251 ns/iter 0.9867887110565703 ns/iter 0.63
Regex_Period_Plus 0.6230655439085647 ns/iter 0.98110532927506 ns/iter 0.64
Regex_Period 0.6257854598748133 ns/iter 0.981110176447579 ns/iter 0.64
Regex_Caret_Period_Plus_Dollar 0.6231462093525858 ns/iter 0.9819007016635659 ns/iter 0.63
Regex_Caret_Group_Period_Plus_Group_Dollar 0.6223692198459024 ns/iter 0.9797726631568059 ns/iter 0.64
Regex_Caret_Period_Asterisk_Dollar 0.6252690757958043 ns/iter 0.9820898410617582 ns/iter 0.64
Regex_Caret_Group_Period_Asterisk_Group_Dollar 0.6228459169009819 ns/iter 0.9872281291329811 ns/iter 0.63
Regex_Caret_X_Hyphen 4.050572352864026 ns/iter 3.3687698195994873 ns/iter 1.20
Regex_Period_Md_Dollar 30.822350486902785 ns/iter 18.29308603985567 ns/iter 1.68
Regex_Caret_Slash_Period_Asterisk 4.359486267343374 ns/iter 3.365219611848266 ns/iter 1.30
Regex_Caret_Period_Range_Dollar 1.2451302574174972 ns/iter 1.6285005670228636 ns/iter 0.76
Regex_Nested_Backtrack 38.121325809936415 ns/iter 35.27438696810939 ns/iter 1.08

This comment was automatically generated by workflow using github-action-benchmark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant