Skip to content

Speed up JSON-LD materialising#2618

Merged
jviotti merged 3 commits into
mainfrom
jsonld-annotation-list
Jul 8, 2026
Merged

Speed up JSON-LD materialising#2618
jviotti merged 3 commits into
mainfrom
jsonld-annotation-list

Conversation

@jviotti

@jviotti jviotti commented Jul 8, 2026

Copy link
Copy Markdown
Member

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

Review in cubic

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

augmentcode Bot commented Jul 8, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR speeds up JSON-LD materialization by replacing map-based annotation lookups with a flat annotation list and a sorted pointer index that can be scanned during the walk.

Changes:

  • Introduce JSONLDBasicAnnotation + JSONLD*AnnotationList (vector-backed) and update exported aliases accordingly
  • Rewrite jsonld_materialize to build a stable-sorted/unique annotation index and pass “annotation ranges” down the traversal
  • Add mutable JSONObject::try_at / JSON::try_at overloads for fast in-place object lookups
  • Use the new mutable lookup API in JSON-LD materialization to avoid redundant defines + at probes when creating predicate arrays
  • Update the JSON-LD benchmark to populate annotation lists and adapt to the new API
  • Update and extend unit tests for JSON mutation via try_at and for JSON-LD materialization behavior with annotation lists

Technical Notes: Duplicate annotations are resolved with “first one wins” semantics via stable_sort + unique, and the traversal relies on canonical key ordering to advance a single scan iterator through the sorted index.

🤖 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. 3 suggestions posted.

Fix All in Augment

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

SOURCEMETA_CORE_JSONLD_EXPORT
auto jsonld_materialize(const JSON &instance, const JSONLDAnnotationMap &map)
-> JSON;
auto jsonld_materialize(const JSON &instance,

@augmentcode augmentcode Bot Jul 8, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

src/core/jsonld/include/sourcemeta/core/jsonld_materialize.h:166: This changes the public API from map-based annotations to JSONLD*AnnotationList and updates the jsonld_materialize overloads accordingly; please make sure this intended breaking change is reflected in versioning/release notes for downstream users.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

index.push_back(&annotation);
}

std::ranges::stable_sort(index,

@augmentcode augmentcode Bot Jul 8, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

src/core/jsonld/jsonld_materialize.cc:474: materialize_root rebuilds and stable_sorts/uniques an index on every jsonld_materialize call, so repeated materializations with the same annotations list now pay an O(n log n) preprocessing cost each time, which may offset the speedup for some callers.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

[](const auto *left, const auto *right) -> bool {
return left->pointer < right->pointer;
});
const auto duplicates{std::ranges::unique(

@augmentcode augmentcode Bot Jul 8, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

src/core/jsonld/jsonld_materialize.cc:478: The documented "first one wins" behavior for duplicate pointers relies on using std::ranges::stable_sort before std::ranges::unique; consider adding a focused unit test covering duplicate annotations to prevent accidental semantic drift.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@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: ccb2e4b Previous: c30b26a Ratio
JOSE_VerifySignature_RS256 22302.794502920795 ns/iter 19020.26586152329 ns/iter 1.17
JOSE_VerifySignature_ES512 578539.4983416261 ns/iter 427806.8312292179 ns/iter 1.35
GZIP_Compress_ISO_Language_Set_3_Locations 36387627.84210389 ns/iter 23770389.166666444 ns/iter 1.53
GZIP_Decompress_ISO_Language_Set_3_Locations 4278038.432927332 ns/iter 3245453.418181848 ns/iter 1.32
GZIP_Compress_ISO_Language_Set_3_Schema 2084728.8818443695 ns/iter 1632696.3744292178 ns/iter 1.28
GZIP_Decompress_ISO_Language_Set_3_Schema 376153.6006440927 ns/iter 307452.4341821212 ns/iter 1.22
HTML_Build_Table_100000 60933290.41667062 ns/iter 42310489.588236816 ns/iter 1.44
HTML_Render_Table_100000 1945487.0672043082 ns/iter 2678701.0613027327 ns/iter 0.73
JSONLD_Catalog_Annotation_List_Populate 1329519.076045667 ns/iter
JSONLD_Catalog_Materialize 6727789.7115386715 ns/iter 11273452.949999789 ns/iter 0.60
JSONL_Parse_Large 13274637.886793071 ns/iter 10116644.609375669 ns/iter 1.31
JSONL_Parse_Large_GZIP 14777112.000001095 ns/iter 11438367.830508167 ns/iter 1.29
URITemplateRouter_Create 30235.6919564753 ns/iter 22743.956353573034 ns/iter 1.33
URITemplateRouter_Match 163.00999334227103 ns/iter 144.5117393177597 ns/iter 1.13
URITemplateRouter_Match_BasePath 189.54717510811912 ns/iter 155.59583717183827 ns/iter 1.22
URITemplateRouterView_Restore 8315.310937244238 ns/iter 2993.786316400256 ns/iter 2.78
URITemplateRouterView_Match 124.26818778707634 ns/iter 98.91196166028116 ns/iter 1.26
URITemplateRouterView_Match_BasePath 142.67556660416182 ns/iter 114.99344657792295 ns/iter 1.24
URITemplateRouterView_Arguments 478.50700322197514 ns/iter 383.43443423286124 ns/iter 1.25
Pointer_Object_Traverse 30.982311375579012 ns/iter 22.69888259750192 ns/iter 1.36
Pointer_Object_Try_Traverse 22.76128858539689 ns/iter 18.887711132742112 ns/iter 1.21
Pointer_Push_Back_Pointer_To_Weak_Pointer 153.33302716205935 ns/iter 128.97572714708227 ns/iter 1.19
Pointer_Walker_Schema_ISO_Language 2582075.5464683417 ns/iter 2079905.949554869 ns/iter 1.24
Pointer_Maybe_Tracked_Deeply_Nested/0 1849049.0053192815 ns/iter 1654340.6941746876 ns/iter 1.12
Pointer_Maybe_Tracked_Deeply_Nested/1 1734570.0786240147 ns/iter 1469571.0526315882 ns/iter 1.18
Pointer_Position_Tracker_Get_Deeply_Nested 395.2783277892899 ns/iter 400.0234342235742 ns/iter 0.99
JSON_Array_Of_Objects_Unique 421.6990425246922 ns/iter 370.2129122515991 ns/iter 1.14
JSON_Parse_1 9687.732625415769 ns/iter 7561.727858499366 ns/iter 1.28
JSON_Parse_Real 7699.097136315889 ns/iter 6018.058542295087 ns/iter 1.28
JSON_Parse_Decimal 12589.203145809068 ns/iter 8641.710821561735 ns/iter 1.46
JSON_Parse_Schema_ISO_Language 6600381.16190576 ns/iter 5167152.370370331 ns/iter 1.28
JSON_Parse_Integer 5621.59858527282 ns/iter 4248.110761164311 ns/iter 1.32
JSON_Parse_String_NonSSO_Plain 11993.693974793261 ns/iter 9409.749254789884 ns/iter 1.27
JSON_Parse_String_SSO_Plain 4999.079898291554 ns/iter 3720.6323929317646 ns/iter 1.34
JSON_Parse_String_Escape_Heavy 25696.146737327384 ns/iter 21149.653615188938 ns/iter 1.21
JSON_Parse_Object_Short_Keys 13537.783529093414 ns/iter 10079.399015343351 ns/iter 1.34
JSON_Parse_Object_Scalar_Properties 6963.192178716244 ns/iter 5192.531722796937 ns/iter 1.34
JSON_Parse_Object_Array_Properties 11871.402042619955 ns/iter 9005.78187654569 ns/iter 1.32
JSON_Parse_Object_Object_Properties 12032.712063460025 ns/iter 9285.990078902181 ns/iter 1.30
JSON_Parse_Nested_Containers 100203.21000566389 ns/iter 82250.66670646121 ns/iter 1.22
JSON_From_String_Copy 18.138804875333673 ns/iter 15.921535601050088 ns/iter 1.14
JSON_From_String_Temporary 15.110751666777736 ns/iter 13.288891309394932 ns/iter 1.14
JSON_Number_To_Double 20.906808427796562 ns/iter 21.76785133165196 ns/iter 0.96
JSON_Object_At_Last_Key/8 5.925463470574363 ns/iter 3.706875877640006 ns/iter 1.60
JSON_Object_At_Last_Key/32 22.503738334679877 ns/iter 11.483129433986608 ns/iter 1.96
JSON_Object_At_Last_Key/128 87.31624858271881 ns/iter 44.38823635660578 ns/iter 1.97
JSON_Object_At_Last_Key/512 402.41675082179023 ns/iter 181.96522834065036 ns/iter 2.21
JSON_Fast_Hash_Helm_Chart_Lock 74.20805928743685 ns/iter 64.26862217224767 ns/iter 1.15
JSON_Equality_Helm_Chart_Lock 169.97383777951012 ns/iter 124.7670604914016 ns/iter 1.36
JSON_Divisible_By_Decimal 249.678354701384 ns/iter 206.60451824547545 ns/iter 1.21
JSON_String_Equal/10 6.059676658982228 ns/iter 4.980027446692608 ns/iter 1.22
JSON_String_Equal/100 6.6714146549162745 ns/iter 6.010057023283997 ns/iter 1.11
JSON_String_Equal_Small_By_Perfect_Hash/10 0.7402759781773169 ns/iter 0.8130630418306388 ns/iter 0.91
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 25.236168436449578 ns/iter 15.016261156995547 ns/iter 1.68
JSON_String_Fast_Hash/10 2.296714877274146 ns/iter 2.9488906674877233 ns/iter 0.78
JSON_String_Fast_Hash/100 2.2982307717730177 ns/iter 2.9522859685853997 ns/iter 0.78
JSON_String_Key_Hash/10 1.2474167790390798 ns/iter 1.7026068793342257 ns/iter 0.73
JSON_String_Key_Hash/100 12.455539730777204 ns/iter 11.311224974835154 ns/iter 1.10
JSON_Object_Defines_Miss_Same_Length 3.116320902666072 ns/iter 2.937200858541941 ns/iter 1.06
JSON_Object_Defines_Miss_Too_Small 3.1146261997766476 ns/iter 2.723553460203391 ns/iter 1.14
JSON_Object_Defines_Miss_Too_Large 3.426058343037691 ns/iter 2.5938824087076138 ns/iter 1.32
Regex_Lower_S_Or_Upper_S_Asterisk 0.6227293365734117 ns/iter 1.13113390591211 ns/iter 0.55
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 0.9350419400960259 ns/iter 0.8460741066931703 ns/iter 1.11
Regex_Period_Asterisk 0.6236833076114847 ns/iter 1.133918171948127 ns/iter 0.55
Regex_Group_Period_Asterisk_Group 0.9365900193899136 ns/iter 0.8565053564488132 ns/iter 1.09
Regex_Period_Plus 0.6229970114650503 ns/iter 1.132152587824721 ns/iter 0.55
Regex_Period 0.9342745593242359 ns/iter 0.859844319532897 ns/iter 1.09
Regex_Caret_Period_Plus_Dollar 0.6232901560853906 ns/iter 1.1642290603615457 ns/iter 0.54
Regex_Caret_Group_Period_Plus_Group_Dollar 0.9343359207522572 ns/iter 0.8466080031041776 ns/iter 1.10
Regex_Caret_Period_Asterisk_Dollar 0.6232114773294533 ns/iter 1.1246360124355432 ns/iter 0.55
Regex_Caret_Group_Period_Asterisk_Group_Dollar 0.9354816015273141 ns/iter 0.8626112443417685 ns/iter 1.08
Regex_Caret_X_Hyphen 3.7421062592879797 ns/iter 3.4316153632644517 ns/iter 1.09
Regex_Period_Md_Dollar 28.455356014796656 ns/iter 15.99093669476965 ns/iter 1.78
Regex_Caret_Slash_Period_Asterisk 4.053316999627048 ns/iter 3.3696656810855177 ns/iter 1.20
Regex_Caret_Period_Range_Dollar 1.559326367211015 ns/iter 1.422106236960045 ns/iter 1.10
Regex_Nested_Backtrack 37.32290077227712 ns/iter 29.832563596032386 ns/iter 1.25

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 (macos/llvm)

Details
Benchmark suite Current: ccb2e4b Previous: c30b26a Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.7941680813756709 ns/iter 1.5792249909364349 ns/iter 1.14
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.8817073093652537 ns/iter 1.5736354392243306 ns/iter 1.20
Regex_Period_Asterisk 1.9178952723025573 ns/iter 1.604891260661497 ns/iter 1.20
Regex_Group_Period_Asterisk_Group 1.8804940173046563 ns/iter 1.5672955194430616 ns/iter 1.20
Regex_Period_Plus 2.345640157492729 ns/iter 1.8938407730336309 ns/iter 1.24
Regex_Period 2.680552760166367 ns/iter 1.8851141475026976 ns/iter 1.42
Regex_Caret_Period_Plus_Dollar 2.043038216167843 ns/iter 1.8829624091517188 ns/iter 1.09
Regex_Caret_Group_Period_Plus_Group_Dollar 2.3868108722524006 ns/iter 2.0599116578433656 ns/iter 1.16
Regex_Caret_Period_Asterisk_Dollar 1.863417478961632 ns/iter 1.5743757752124994 ns/iter 1.18
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.0946369243192327 ns/iter 1.5730056030696222 ns/iter 1.33
Regex_Caret_X_Hyphen 6.163536085716647 ns/iter 5.655836334210372 ns/iter 1.09
Regex_Period_Md_Dollar 17.105541933211608 ns/iter 16.635875143382243 ns/iter 1.03
Regex_Caret_Slash_Period_Asterisk 4.4213827267921255 ns/iter 4.100247359224097 ns/iter 1.08
Regex_Caret_Period_Range_Dollar 1.9637471682804297 ns/iter 1.9776188938076324 ns/iter 0.99
Regex_Nested_Backtrack 26.503320827808892 ns/iter 24.434499843250137 ns/iter 1.08
JSON_Array_Of_Objects_Unique 344.27242015062114 ns/iter 324.43892354010546 ns/iter 1.06
JSON_Parse_1 6587.727262958169 ns/iter 6172.788922792371 ns/iter 1.07
JSON_Parse_Real 6461.874413859921 ns/iter 6068.47242662936 ns/iter 1.06
JSON_Parse_Decimal 7347.655535282386 ns/iter 6821.386452867753 ns/iter 1.08
JSON_Parse_Schema_ISO_Language 3999923.1919191605 ns/iter 3713421.794871535 ns/iter 1.08
JSON_Parse_Integer 4299.318339353922 ns/iter 4292.198818247182 ns/iter 1.00
JSON_Parse_String_NonSSO_Plain 7205.428339698791 ns/iter 6760.093845888749 ns/iter 1.07
JSON_Parse_String_SSO_Plain 2787.0361729500687 ns/iter 3081.9580983139094 ns/iter 0.90
JSON_Parse_String_Escape_Heavy 21862.96936596101 ns/iter 19720.694559677006 ns/iter 1.11
JSON_Parse_Object_Short_Keys 7737.423804629101 ns/iter 7477.221277500528 ns/iter 1.03
JSON_Parse_Object_Scalar_Properties 4535.615293206948 ns/iter 3945.2562818317215 ns/iter 1.15
JSON_Parse_Object_Array_Properties 7538.085759634235 ns/iter 6514.388511729752 ns/iter 1.16
JSON_Parse_Object_Object_Properties 6829.754359771145 ns/iter 6781.85246657012 ns/iter 1.01
JSON_Parse_Nested_Containers 57301.060844498694 ns/iter 55103.30281968268 ns/iter 1.04
JSON_From_String_Copy 23.227836809711313 ns/iter 21.681839564005553 ns/iter 1.07
JSON_From_String_Temporary 18.304662111892874 ns/iter 17.85367010770523 ns/iter 1.03
JSON_Number_To_Double 33.581197553553515 ns/iter 29.871040434520832 ns/iter 1.12
JSON_Object_At_Last_Key/8 3.7837525238331615 ns/iter 3.7631569841812804 ns/iter 1.01
JSON_Object_At_Last_Key/32 11.786871330152927 ns/iter 11.32508301304743 ns/iter 1.04
JSON_Object_At_Last_Key/128 52.334296675622255 ns/iter 52.5702709244759 ns/iter 1.00
JSON_Object_At_Last_Key/512 174.64060047021425 ns/iter 173.6014321892812 ns/iter 1.01
JSON_Fast_Hash_Helm_Chart_Lock 54.53085532416198 ns/iter 54.47068702506557 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 128.00719560941062 ns/iter 128.39268731526798 ns/iter 1.00
JSON_Divisible_By_Decimal 165.6606227703283 ns/iter 165.53287163202103 ns/iter 1.00
JSON_String_Equal/10 6.307595501226149 ns/iter 6.28443091908414 ns/iter 1.00
JSON_String_Equal/100 6.017693643708426 ns/iter 5.96485244184094 ns/iter 1.01
JSON_String_Equal_Small_By_Perfect_Hash/10 0.3162490789010917 ns/iter 0.3134788373504555 ns/iter 1.01
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.1455671459768 ns/iter 3.0467382331335324 ns/iter 1.03
JSON_String_Fast_Hash/10 2.3380285690269194 ns/iter 2.19953221746515 ns/iter 1.06
JSON_String_Fast_Hash/100 2.000977732171851 ns/iter 1.8933934749143497 ns/iter 1.06
JSON_String_Key_Hash/10 1.6830297739270792 ns/iter 1.5812336560173001 ns/iter 1.06
JSON_String_Key_Hash/100 1.9743997707796241 ns/iter 2.1053178242538446 ns/iter 0.94
JSON_Object_Defines_Miss_Same_Length 2.548712048319876 ns/iter 2.531861951756289 ns/iter 1.01
JSON_Object_Defines_Miss_Too_Small 2.5107017719126006 ns/iter 2.515107899564456 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 2.5126302342940177 ns/iter 2.6341760846345332 ns/iter 0.95
Pointer_Object_Traverse 22.216153331887313 ns/iter 22.226639107225633 ns/iter 1.00
Pointer_Object_Try_Traverse 23.83521516774182 ns/iter 22.936841097371232 ns/iter 1.04
Pointer_Push_Back_Pointer_To_Weak_Pointer 163.8245444187703 ns/iter 163.26834187512685 ns/iter 1.00
Pointer_Walker_Schema_ISO_Language 2366026.5151518383 ns/iter 2443606.6993241576 ns/iter 0.97
Pointer_Maybe_Tracked_Deeply_Nested/0 1131695.406299127 ns/iter 1115989.478114405 ns/iter 1.01
Pointer_Maybe_Tracked_Deeply_Nested/1 957561.1814346337 ns/iter 919507.1169513614 ns/iter 1.04
Pointer_Position_Tracker_Get_Deeply_Nested 331.0130700328499 ns/iter 311.94022287004924 ns/iter 1.06
URITemplateRouter_Create 23405.330067710973 ns/iter 22941.760351824567 ns/iter 1.02
URITemplateRouter_Match 160.52660738795348 ns/iter 155.62100397310655 ns/iter 1.03
URITemplateRouter_Match_BasePath 182.75566173312035 ns/iter 183.6732395315055 ns/iter 1.00
URITemplateRouterView_Restore 9509.285677663684 ns/iter 9679.20350969393 ns/iter 0.98
URITemplateRouterView_Match 133.67265413530467 ns/iter 124.24223488673569 ns/iter 1.08
URITemplateRouterView_Match_BasePath 146.85825326112467 ns/iter 141.64155108758584 ns/iter 1.04
URITemplateRouterView_Arguments 510.45053308059937 ns/iter 510.27662628876493 ns/iter 1.00
JSONL_Parse_Large 9433451.013513925 ns/iter 10479349.507462038 ns/iter 0.90
JSONL_Parse_Large_GZIP 12070722.626865415 ns/iter 11291784.194028553 ns/iter 1.07
JSONLD_Catalog_Annotation_List_Populate 922476.5917603954 ns/iter
JSONLD_Catalog_Materialize 5741522.92000008 ns/iter 10555516.179105759 ns/iter 0.54
HTML_Build_Table_100000 46377502.33333311 ns/iter 34684069.4285707 ns/iter 1.34
HTML_Render_Table_100000 1947784.7222220344 ns/iter 1675746.5330813043 ns/iter 1.16
GZIP_Compress_ISO_Language_Set_3_Locations 25847769.230770506 ns/iter 25531949.07407201 ns/iter 1.01
GZIP_Decompress_ISO_Language_Set_3_Locations 3280934.0798122054 ns/iter 3063168.859648812 ns/iter 1.07
GZIP_Compress_ISO_Language_Set_3_Schema 1706713.903465495 ns/iter 1401067.1875001416 ns/iter 1.22
GZIP_Decompress_ISO_Language_Set_3_Schema 280303.84324537945 ns/iter 249504.061194553 ns/iter 1.12
JOSE_VerifySignature_RS256 21779.13751043008 ns/iter 20290.231177804646 ns/iter 1.07
JOSE_VerifySignature_ES512 1176989.8819561198 ns/iter 1037666.7904903922 ns/iter 1.13

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: ccb2e4b Previous: c30b26a Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.463222701637329 ns/iter 2.8136425128356537 ns/iter 0.88
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.471689700794564 ns/iter 2.8136890572402864 ns/iter 0.88
Regex_Period_Asterisk 2.4623445676518725 ns/iter 2.8142226971448387 ns/iter 0.87
Regex_Group_Period_Asterisk_Group 2.4620085067205215 ns/iter 3.168023452717129 ns/iter 0.78
Regex_Period_Plus 3.516640393510468 ns/iter 4.23037529661281 ns/iter 0.83
Regex_Period 3.5170338295833106 ns/iter 4.225813760121587 ns/iter 0.83
Regex_Caret_Period_Plus_Dollar 3.8658989760450937 ns/iter 4.228177333882654 ns/iter 0.91
Regex_Caret_Group_Period_Plus_Group_Dollar 3.866424143293183 ns/iter 4.578868309268568 ns/iter 0.84
Regex_Caret_Period_Asterisk_Dollar 2.463739374051079 ns/iter 3.1896568229630917 ns/iter 0.77
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.4618749858257902 ns/iter 3.238213075956561 ns/iter 0.76
Regex_Caret_X_Hyphen 7.119466763108123 ns/iter 5.981800579379958 ns/iter 1.19
Regex_Period_Md_Dollar 26.270828420085515 ns/iter 26.280300122354397 ns/iter 1.00
Regex_Caret_Slash_Period_Asterisk 7.340655651779606 ns/iter 6.328386137352452 ns/iter 1.16
Regex_Caret_Period_Range_Dollar 4.218203416345741 ns/iter 3.165830644983814 ns/iter 1.33
Regex_Nested_Backtrack 38.27427378292445 ns/iter 38.538691923522386 ns/iter 0.99
JSON_Array_Of_Objects_Unique 466.43306193550734 ns/iter 424.880529270843 ns/iter 1.10
JSON_Parse_1 4630.776559715851 ns/iter 4836.339572560973 ns/iter 0.96
JSON_Parse_Real 5150.155897391227 ns/iter 5291.325682770857 ns/iter 0.97
JSON_Parse_Decimal 7565.776811094033 ns/iter 7585.189673374892 ns/iter 1.00
JSON_Parse_Schema_ISO_Language 3609647.569230499 ns/iter 3607001.809278423 ns/iter 1.00
JSON_Parse_Integer 3953.6258309918144 ns/iter 4042.907062445035 ns/iter 0.98
JSON_Parse_String_NonSSO_Plain 5068.133181278282 ns/iter 5137.711050974139 ns/iter 0.99
JSON_Parse_String_SSO_Plain 2799.152020179702 ns/iter 2884.706325183272 ns/iter 0.97
JSON_Parse_String_Escape_Heavy 14487.247969164757 ns/iter 15206.94598295756 ns/iter 0.95
JSON_Parse_Object_Short_Keys 7871.18445008892 ns/iter 8164.595270150873 ns/iter 0.96
JSON_Parse_Object_Scalar_Properties 3997.49200456896 ns/iter 4123.919961238862 ns/iter 0.97
JSON_Parse_Object_Array_Properties 5472.615701549828 ns/iter 5636.584735205233 ns/iter 0.97
JSON_Parse_Object_Object_Properties 5421.168024853359 ns/iter 5647.727722931281 ns/iter 0.96
JSON_Parse_Nested_Containers 44479.52403968069 ns/iter 45132.994868463604 ns/iter 0.99
JSON_From_String_Copy 21.103003175800477 ns/iter 22.881151871218393 ns/iter 0.92
JSON_From_String_Temporary 18.6377530568551 ns/iter 20.429786298258815 ns/iter 0.91
JSON_Number_To_Double 22.54952773736044 ns/iter 22.540581649785537 ns/iter 1.00
JSON_Object_At_Last_Key/8 4.059352597112769 ns/iter 4.024590304400142 ns/iter 1.01
JSON_Object_At_Last_Key/32 13.247868302631968 ns/iter 13.209080011534047 ns/iter 1.00
JSON_Object_At_Last_Key/128 56.62916076602101 ns/iter 56.681948484327165 ns/iter 1.00
JSON_Object_At_Last_Key/512 370.6375639861108 ns/iter 371.59258546065473 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 68.57321247041331 ns/iter 69.96143902761547 ns/iter 0.98
JSON_Equality_Helm_Chart_Lock 164.27656466587482 ns/iter 160.07535253838597 ns/iter 1.03
JSON_Divisible_By_Decimal 252.31148086751878 ns/iter 248.8826575542752 ns/iter 1.01
JSON_String_Equal/10 5.9797336968570285 ns/iter 5.628734598193536 ns/iter 1.06
JSON_String_Equal/100 6.683806933670908 ns/iter 6.3358487286857255 ns/iter 1.05
JSON_String_Equal_Small_By_Perfect_Hash/10 1.0546561966872647 ns/iter 1.1054664352117272 ns/iter 0.95
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 12.334629120850769 ns/iter 12.483707127955315 ns/iter 0.99
JSON_String_Fast_Hash/10 2.1116908219620454 ns/iter 2.461582552501708 ns/iter 0.86
JSON_String_Fast_Hash/100 2.110594234819104 ns/iter 2.461991150820031 ns/iter 0.86
JSON_String_Key_Hash/10 2.461460169982715 ns/iter 2.4608167051130696 ns/iter 1.00
JSON_String_Key_Hash/100 8.082931257520356 ns/iter 8.084765825715284 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 2.9335140788334355 ns/iter 2.959329312934605 ns/iter 0.99
JSON_Object_Defines_Miss_Too_Small 3.0342779467668475 ns/iter 2.923866496940652 ns/iter 1.04
JSON_Object_Defines_Miss_Too_Large 4.228609621362816 ns/iter 4.2219254231669625 ns/iter 1.00
Pointer_Object_Traverse 30.648944845396883 ns/iter 30.58532924820036 ns/iter 1.00
Pointer_Object_Try_Traverse 33.346291248184244 ns/iter 32.9742371486252 ns/iter 1.01
Pointer_Push_Back_Pointer_To_Weak_Pointer 212.89377078393267 ns/iter 186.46858235299436 ns/iter 1.14
Pointer_Walker_Schema_ISO_Language 2805083.1462450344 ns/iter 2756158.9137255447 ns/iter 1.02
Pointer_Maybe_Tracked_Deeply_Nested/0 1242783.9964726681 ns/iter 1295608.4195934427 ns/iter 0.96
Pointer_Maybe_Tracked_Deeply_Nested/1 1588122.5114676578 ns/iter 1624262.9350350406 ns/iter 0.98
Pointer_Position_Tracker_Get_Deeply_Nested 742.8208434678577 ns/iter 739.6809260849684 ns/iter 1.00
URITemplateRouter_Create 30075.124229455825 ns/iter 30683.94520608632 ns/iter 0.98
URITemplateRouter_Match 176.84913236732527 ns/iter 181.87553599089637 ns/iter 0.97
URITemplateRouter_Match_BasePath 208.27538645095305 ns/iter 218.11592885586185 ns/iter 0.95
URITemplateRouterView_Restore 9855.834682097497 ns/iter 9841.852502376087 ns/iter 1.00
URITemplateRouterView_Match 145.21814909921602 ns/iter 173.34367477890203 ns/iter 0.84
URITemplateRouterView_Match_BasePath 165.29438486227272 ns/iter 197.62010776903833 ns/iter 0.84
URITemplateRouterView_Arguments 457.61101703276836 ns/iter 454.7941308067371 ns/iter 1.01
JSONL_Parse_Large 8951703.166666484 ns/iter 9348357.253332628 ns/iter 0.96
JSONL_Parse_Large_GZIP 10662585.272727523 ns/iter 11048762.555555228 ns/iter 0.97
JSONLD_Catalog_Annotation_List_Populate 1305839.820702414 ns/iter
JSONLD_Catalog_Materialize 4322132.300613323 ns/iter 16903266.731704693 ns/iter 0.26
HTML_Build_Table_100000 69434087.90000376 ns/iter 80190945.2222339 ns/iter 0.87
HTML_Render_Table_100000 4778795.335615909 ns/iter 5343757.192307609 ns/iter 0.89
GZIP_Compress_ISO_Language_Set_3_Locations 35488746.150002725 ns/iter 35554593.19999841 ns/iter 1.00
GZIP_Decompress_ISO_Language_Set_3_Locations 4275119.073171032 ns/iter 4313968.82098723 ns/iter 0.99
GZIP_Compress_ISO_Language_Set_3_Schema 2120451.9696049145 ns/iter 2116912.534742976 ns/iter 1.00
GZIP_Decompress_ISO_Language_Set_3_Schema 275449.344881895 ns/iter 276912.0750691532 ns/iter 0.99
JOSE_VerifySignature_RS256 63815.529101019834 ns/iter 63840.09173727245 ns/iter 1.00
JOSE_VerifySignature_ES512 2676100.8664123905 ns/iter 2666216.1330798576 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.

1 issue found across 4 files

Not reviewed (too large): test/jsonld/jsonld_materialize_test.cc (~1,397 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="benchmark/jsonld.cc">

<violation number="1" location="benchmark/jsonld.cc:14">
P3: Subject-verb agreement in updated comment: 'the annotations carries' should be 'the annotations carry' (plural noun needs plural verb) or 'the annotations list carries' to keep singular agreement.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread benchmark/jsonld.cc Outdated
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>

@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: ccb2e4b Previous: c30b26a Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 5.060098214284738 ns/iter 5.0861010000005535 ns/iter 0.99
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 5.027573999998367 ns/iter 5.0369579999994585 ns/iter 1.00
Regex_Period_Asterisk 5.034183000000212 ns/iter 5.045698999999786 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 5.046709999999166 ns/iter 5.041748000001007 ns/iter 1.00
Regex_Period_Plus 4.799809162498385 ns/iter 5.04789399999936 ns/iter 0.95
Regex_Period 4.784468314250295 ns/iter 5.216380000000527 ns/iter 0.92
Regex_Caret_Period_Plus_Dollar 4.7753133928572264 ns/iter 5.036080999999513 ns/iter 0.95
Regex_Caret_Group_Period_Plus_Group_Dollar 4.780620715353296 ns/iter 5.0877969999999095 ns/iter 0.94
Regex_Caret_Period_Asterisk_Dollar 5.021030000000337 ns/iter 5.16413125000018 ns/iter 0.97
Regex_Caret_Group_Period_Asterisk_Group_Dollar 5.027423999999883 ns/iter 5.02904600000079 ns/iter 1.00
Regex_Caret_X_Hyphen 8.24918165960115 ns/iter 8.22389732142754 ns/iter 1.00
Regex_Period_Md_Dollar 44.744429035285506 ns/iter 44.84177392998117 ns/iter 1.00
Regex_Caret_Slash_Period_Asterisk 7.869649107143621 ns/iter 7.888768973214967 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 5.65577946428724 ns/iter 5.67319999999987 ns/iter 1.00
Regex_Nested_Backtrack 58.83810000000267 ns/iter 55.62237500000273 ns/iter 1.06
JSON_Array_Of_Objects_Unique 618.2077678571676 ns/iter 594.7487500000038 ns/iter 1.04
JSON_Parse_1 9264.933638689788 ns/iter 9289.984866139603 ns/iter 1.00
JSON_Parse_Real 15928.810267859766 ns/iter 16161.58035714323 ns/iter 0.99
JSON_Parse_Decimal 11693.765625000908 ns/iter 11869.607812499793 ns/iter 0.99
JSON_Parse_Schema_ISO_Language 7854208.928571487 ns/iter 7815339.999999398 ns/iter 1.00
JSON_Parse_Integer 6064.555357141898 ns/iter 6183.08571428575 ns/iter 0.98
JSON_Parse_String_NonSSO_Plain 7913.824776785308 ns/iter 7820.9252232142035 ns/iter 1.01
JSON_Parse_String_SSO_Plain 3761.5732829046055 ns/iter 3732.7390486804693 ns/iter 1.01
JSON_Parse_String_Escape_Heavy 22007.40624999753 ns/iter 21631.643749998377 ns/iter 1.02
JSON_Parse_Object_Short_Keys 13233.82142857099 ns/iter 13198.510714285509 ns/iter 1.00
JSON_Parse_Object_Scalar_Properties 6824.633928572052 ns/iter 6786.641964285626 ns/iter 1.01
JSON_Parse_Object_Array_Properties 11432.367187499181 ns/iter 11301.789062500233 ns/iter 1.01
JSON_Parse_Object_Object_Properties 11555.553124999562 ns/iter 11466.483928570273 ns/iter 1.01
JSON_Parse_Nested_Containers 80419.2299107141 ns/iter 79619.49776785611 ns/iter 1.01
JSON_From_String_Copy 63.97011607142693 ns/iter 63.74341071428091 ns/iter 1.00
JSON_From_String_Temporary 57.77313392858982 ns/iter 57.660964285710335 ns/iter 1.00
JSON_Number_To_Double 119.60189285714154 ns/iter 121.22037500000309 ns/iter 0.99
JSON_Object_At_Last_Key/8 7.231018973212448 ns/iter 7.520291071428582 ns/iter 0.96
JSON_Object_At_Last_Key/32 22.949226306372378 ns/iter 23.448247506158985 ns/iter 0.98
JSON_Object_At_Last_Key/128 89.06058084550821 ns/iter 89.77571920644436 ns/iter 0.99
JSON_Object_At_Last_Key/512 424.2014055670932 ns/iter 414.8858014330457 ns/iter 1.02
JSON_Fast_Hash_Helm_Chart_Lock 106.77878125001426 ns/iter 104.48793750001073 ns/iter 1.02
JSON_Equality_Helm_Chart_Lock 209.12457771771014 ns/iter 216.34321874998363 ns/iter 0.97
JSON_Divisible_By_Decimal 299.7855714525171 ns/iter 307.5339656770056 ns/iter 0.97
JSON_String_Equal/10 10.93250156249681 ns/iter 10.842048437499585 ns/iter 1.01
JSON_String_Equal/100 12.671584095218673 ns/iter 11.947232142856837 ns/iter 1.06
JSON_String_Equal_Small_By_Perfect_Hash/10 2.5253819168241503 ns/iter 2.5623049999999075 ns/iter 0.99
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 15.035385870376848 ns/iter 15.035990557874221 ns/iter 1.00
JSON_String_Fast_Hash/10 6.9128285714279105 ns/iter 6.631803571428309 ns/iter 1.04
JSON_String_Fast_Hash/100 6.918563392856316 ns/iter 6.6019901785716275 ns/iter 1.05
JSON_String_Key_Hash/10 5.330739999999423 ns/iter 5.338424000000259 ns/iter 1.00
JSON_String_Key_Hash/100 11.876114285716508 ns/iter 11.903091071429474 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 4.080473087644972 ns/iter 3.7855848146688325 ns/iter 1.08
JSON_Object_Defines_Miss_Too_Small 4.392505056178013 ns/iter 4.084528623365233 ns/iter 1.08
JSON_Object_Defines_Miss_Too_Large 4.086574382297242 ns/iter 3.779528564679407 ns/iter 1.08
Pointer_Object_Traverse 70.00926339286093 ns/iter 70.73070312500565 ns/iter 0.99
Pointer_Object_Try_Traverse 73.76483928571328 ns/iter 70.71399553571263 ns/iter 1.04
Pointer_Push_Back_Pointer_To_Weak_Pointer 168.77687500002227 ns/iter 163.63667390424249 ns/iter 1.03
Pointer_Walker_Schema_ISO_Language 10980157.812500834 ns/iter 10456139.062499758 ns/iter 1.05
Pointer_Maybe_Tracked_Deeply_Nested/0 2464694.6428577267 ns/iter 2873764.062500328 ns/iter 0.86
Pointer_Maybe_Tracked_Deeply_Nested/1 3964535.195531141 ns/iter 4495304.8192772 ns/iter 0.88
Pointer_Position_Tracker_Get_Deeply_Nested 552.4446428571496 ns/iter 543.8054687500074 ns/iter 1.02
URITemplateRouter_Create 40839.13698547228 ns/iter 41166.49643084662 ns/iter 0.99
URITemplateRouter_Match 234.4100966060301 ns/iter 236.0256767828338 ns/iter 0.99
URITemplateRouter_Match_BasePath 266.09494045065395 ns/iter 270.8185057670484 ns/iter 0.98
URITemplateRouterView_Restore 32829.395771815005 ns/iter 31026.61160714401 ns/iter 1.06
URITemplateRouterView_Match 183.12242706451292 ns/iter 181.05617688000538 ns/iter 1.01
URITemplateRouterView_Match_BasePath 205.67653099658756 ns/iter 205.04402879266513 ns/iter 1.00
URITemplateRouterView_Arguments 538.9090000001033 ns/iter 531.1752999999726 ns/iter 1.01
JSONL_Parse_Large 33997955.00000664 ns/iter 32844166.666666836 ns/iter 1.04
JSONL_Parse_Large_GZIP 34046128.57143331 ns/iter 33433876.19047787 ns/iter 1.02
JSONLD_Catalog_Annotation_List_Populate 2661151.428571072 ns/iter
JSONLD_Catalog_Materialize 7883586.666666816 ns/iter 19874932.352940828 ns/iter 0.40
HTML_Build_Table_100000 89375685.7142632 ns/iter 89195055.55554174 ns/iter 1.00
HTML_Render_Table_100000 7669393.333334383 ns/iter 7709604.444443761 ns/iter 0.99
GZIP_Compress_ISO_Language_Set_3_Locations 36433678.947368644 ns/iter 36214126.315790534 ns/iter 1.01
GZIP_Decompress_ISO_Language_Set_3_Locations 9915571.874998363 ns/iter 9939256.250000028 ns/iter 1.00
GZIP_Compress_ISO_Language_Set_3_Schema 2145576.521739265 ns/iter 2110396.874999765 ns/iter 1.02
GZIP_Decompress_ISO_Language_Set_3_Schema 650155.3571430309 ns/iter 637625.0892856205 ns/iter 1.02
JOSE_VerifySignature_RS256 21405.87893912529 ns/iter 21232.481250002875 ns/iter 1.01
JOSE_VerifySignature_ES512 1575895.582329146 ns/iter 1533027.6785715367 ns/iter 1.03

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

@jviotti

jviotti commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

augment review

@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.

return build_collection(value, pointer, range, standalone, false);
}

return materialize_literal(JSONLDLiteral{}, value);

@augmentcode augmentcode Bot Jul 8, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

src/core/jsonld/jsonld_materialize.cc:336: materialize_member now defaults undescribed non-object collection members to literals/collections instead of dropping them, which is a semantic change from the prior materialization behavior. Consider confirming this is intended and documenting it as part of the JSON-LD materialization contract/release notes for downstream users.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti merged commit 367f6ef into main Jul 8, 2026
12 checks passed
@jviotti jviotti deleted the jsonld-annotation-list branch July 8, 2026 20:23
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