Skip to content

Prototype a simple JSON Path implementation#2622

Merged
jviotti merged 13 commits into
mainfrom
jsonpath
Jul 10, 2026
Merged

Prototype a simple JSON Path implementation#2622
jviotti merged 13 commits into
mainfrom
jsonpath

Conversation

@jviotti

@jviotti jviotti commented Jul 10, 2026

Copy link
Copy Markdown
Member

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

Review in cubic

@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: dfb000d Previous: af1b297 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.707463591497029 ns/iter 2.3416674931582664 ns/iter 0.73
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.629174639831185 ns/iter 2.200143940408056 ns/iter 0.74
Regex_Period_Asterisk 1.6681955266860602 ns/iter 2.394990682845474 ns/iter 0.70
Regex_Group_Period_Asterisk_Group 1.6977796910251308 ns/iter 2.3815664973626656 ns/iter 0.71
Regex_Period_Plus 2.017846541364048 ns/iter 2.612309447171097 ns/iter 0.77
Regex_Period 2.088934257374444 ns/iter 2.6042348583126866 ns/iter 0.80
Regex_Caret_Period_Plus_Dollar 1.9886446905017725 ns/iter 2.5352170377594487 ns/iter 0.78
Regex_Caret_Group_Period_Plus_Group_Dollar 1.9860489049227077 ns/iter 2.6889393026604744 ns/iter 0.74
Regex_Caret_Period_Asterisk_Dollar 1.6806965600358923 ns/iter 2.6629245885048722 ns/iter 0.63
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.6887983250980287 ns/iter 2.3332452477908467 ns/iter 0.72
Regex_Caret_X_Hyphen 6.082326681086688 ns/iter 8.403343981634467 ns/iter 0.72
Regex_Period_Md_Dollar 16.830888778226253 ns/iter 22.44552103605751 ns/iter 0.75
Regex_Caret_Slash_Period_Asterisk 4.600879801608644 ns/iter 6.104366224624493 ns/iter 0.75
Regex_Caret_Period_Range_Dollar 2.033096477921387 ns/iter 2.8399720680869986 ns/iter 0.72
Regex_Nested_Backtrack 25.626227104758787 ns/iter 35.22674156060519 ns/iter 0.73
JSON_Array_Of_Objects_Unique 343.90937619114396 ns/iter 448.4245700127244 ns/iter 0.77
JSON_Parse_1 7139.148122344463 ns/iter 8730.533616725786 ns/iter 0.82
JSON_Parse_Real 7095.711866301713 ns/iter 9278.852160098819 ns/iter 0.76
JSON_Parse_Decimal 7890.401475092954 ns/iter 11100.738991230897 ns/iter 0.71
JSON_Parse_Schema_ISO_Language 3726038.3926708656 ns/iter 5492046.435114118 ns/iter 0.68
JSON_Parse_Integer 4659.2208239946685 ns/iter 6764.8323294352 ns/iter 0.69
JSON_Parse_String_NonSSO_Plain 7415.84526356459 ns/iter 11080.78954231829 ns/iter 0.67
JSON_Parse_String_SSO_Plain 2877.687457124154 ns/iter 3853.1790239879806 ns/iter 0.75
JSON_Parse_String_Escape_Heavy 23690.383471499783 ns/iter 32255.320113800353 ns/iter 0.73
JSON_Parse_Object_Short_Keys 8534.761667549932 ns/iter 12174.184820480155 ns/iter 0.70
JSON_Parse_Object_Scalar_Properties 4767.064412417495 ns/iter 7587.967437882487 ns/iter 0.63
JSON_Parse_Object_Array_Properties 8048.409264017982 ns/iter 10498.290000158275 ns/iter 0.77
JSON_Parse_Object_Object_Properties 7957.89444634584 ns/iter 11540.47409318708 ns/iter 0.69
JSON_Parse_Nested_Containers 64562.14972308843 ns/iter 83702.41958748223 ns/iter 0.77
JSON_From_String_Copy 28.367362823814748 ns/iter 30.948244974940405 ns/iter 0.92
JSON_From_String_Temporary 23.366377615929668 ns/iter 24.58731924403989 ns/iter 0.95
JSON_Number_To_Double 36.238651414197896 ns/iter 53.62771250000833 ns/iter 0.68
JSON_Object_At_Last_Key/8 4.496523508240129 ns/iter 5.508418602124309 ns/iter 0.82
JSON_Object_At_Last_Key/32 12.555073746876179 ns/iter 16.57057228436427 ns/iter 0.76
JSON_Object_At_Last_Key/128 59.4153921335027 ns/iter 67.45876992550502 ns/iter 0.88
JSON_Object_At_Last_Key/512 227.84240630416772 ns/iter 272.8372249234977 ns/iter 0.84
JSON_Fast_Hash_Helm_Chart_Lock 69.21800728007229 ns/iter 76.19917088679526 ns/iter 0.91
JSON_Equality_Helm_Chart_Lock 171.38053467802212 ns/iter 181.71516197457592 ns/iter 0.94
JSON_Divisible_By_Decimal 225.12140644151557 ns/iter 238.3331115370269 ns/iter 0.94
JSON_String_Equal/10 9.508408550857352 ns/iter 9.295006081502255 ns/iter 1.02
JSON_String_Equal/100 9.067977010867068 ns/iter 10.544357671724587 ns/iter 0.86
JSON_String_Equal_Small_By_Perfect_Hash/10 0.4095914138805425 ns/iter 0.41731107251888516 ns/iter 0.98
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 5.191872579695978 ns/iter 5.198213778983294 ns/iter 1.00
JSON_String_Fast_Hash/10 3.561073878453371 ns/iter 3.4673437516928045 ns/iter 1.03
JSON_String_Fast_Hash/100 2.444648703082622 ns/iter 2.723279257426744 ns/iter 0.90
JSON_String_Key_Hash/10 1.7031955508863823 ns/iter 2.7623618316160057 ns/iter 0.62
JSON_String_Key_Hash/100 2.0572886678173754 ns/iter 3.514503263522979 ns/iter 0.59
JSON_Object_Defines_Miss_Same_Length 2.709794238290139 ns/iter 4.050557459735462 ns/iter 0.67
JSON_Object_Defines_Miss_Too_Small 2.603018509325731 ns/iter 3.3462776498136906 ns/iter 0.78
JSON_Object_Defines_Miss_Too_Large 2.671934004072374 ns/iter 3.393870280165277 ns/iter 0.79
Pointer_Object_Traverse 22.804004807348196 ns/iter 27.63268678329571 ns/iter 0.83
Pointer_Object_Try_Traverse 22.08590608966736 ns/iter 28.541119843380496 ns/iter 0.77
Pointer_Push_Back_Pointer_To_Weak_Pointer 171.19684079790363 ns/iter 197.49866082707956 ns/iter 0.87
Pointer_Walker_Schema_ISO_Language 2545073.6939496747 ns/iter 3139652.912621395 ns/iter 0.81
Pointer_Maybe_Tracked_Deeply_Nested/0 1213361.7366669115 ns/iter 1334024.6838093402 ns/iter 0.91
Pointer_Maybe_Tracked_Deeply_Nested/1 1184312.8312102347 ns/iter 1090559.5501475837 ns/iter 1.09
Pointer_Position_Tracker_Get_Deeply_Nested 327.36446250729284 ns/iter 444.9040746407871 ns/iter 0.74
JSONPath_Descendant_Filter_Nested 1297.6667358371656 ns/iter
URITemplateRouter_Create 23748.75051077545 ns/iter 26943.661077892022 ns/iter 0.88
URITemplateRouter_Match 169.32106515915942 ns/iter 172.49791756774775 ns/iter 0.98
URITemplateRouter_Match_BasePath 208.95295522212143 ns/iter 240.76002512832207 ns/iter 0.87
URITemplateRouterView_Restore 27411.094949192768 ns/iter 17464.86946211173 ns/iter 1.57
URITemplateRouterView_Match 170.18737808913733 ns/iter 172.459050735864 ns/iter 0.99
URITemplateRouterView_Match_BasePath 170.52644939393204 ns/iter 181.94701705370696 ns/iter 0.94
URITemplateRouterView_Arguments 574.2857823813472 ns/iter 678.5428442383502 ns/iter 0.85
JSONL_Parse_Large 10452983.835821487 ns/iter 13519231.382980116 ns/iter 0.77
JSONL_Parse_Large_GZIP 12069748.639346547 ns/iter 13517085.730770674 ns/iter 0.89
JSONLD_Catalog_Annotation_List_Populate 920160.6607144196 ns/iter 1209046.0489912992 ns/iter 0.76
JSONLD_Catalog_Materialize 4317959.859755907 ns/iter 6439098.422413085 ns/iter 0.67
HTML_Build_Table_100000 41271300.94444612 ns/iter 62084922.26666446 ns/iter 0.66
HTML_Render_Table_100000 1870358.967479732 ns/iter 2074480.2679127986 ns/iter 0.90
GZIP_Compress_ISO_Language_Set_3_Locations 25413321.428573 ns/iter 91044954.38095044 ns/iter 0.28
GZIP_Decompress_ISO_Language_Set_3_Locations 3192064.8148147594 ns/iter 5684387.596899387 ns/iter 0.56
GZIP_Compress_ISO_Language_Set_3_Schema 1467145.134453778 ns/iter 2985883.7637541685 ns/iter 0.49
GZIP_Decompress_ISO_Language_Set_3_Schema 265570.5102958347 ns/iter 450380.5905956698 ns/iter 0.59
JOSE_VerifySignature_RS256 22362.370071995472 ns/iter 39873.05391729124 ns/iter 0.56
JOSE_VerifySignature_ES512 1135048.8145578674 ns/iter 1748646.2933754902 ns/iter 0.65

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/gcc)

Details
Benchmark suite Current: dfb000d Previous: af1b297 Ratio
JOSE_VerifySignature_RS256 22393.724017039116 ns/iter 22315.580067667262 ns/iter 1.00
JOSE_VerifySignature_ES512 478385.1959972393 ns/iter 575472.8564145637 ns/iter 0.83
GZIP_Compress_ISO_Language_Set_3_Locations 27106806.80768991 ns/iter 36274124.73684599 ns/iter 0.75
GZIP_Decompress_ISO_Language_Set_3_Locations 3611841.3917528857 ns/iter 4169974.581818127 ns/iter 0.87
GZIP_Compress_ISO_Language_Set_3_Schema 1847043.0403225378 ns/iter 2014799.4121036723 ns/iter 0.92
GZIP_Decompress_ISO_Language_Set_3_Schema 350967.5871975625 ns/iter 376738.19096293626 ns/iter 0.93
HTML_Build_Table_100000 53820272.36363352 ns/iter 59357895.83332962 ns/iter 0.91
HTML_Render_Table_100000 2952990.56034488 ns/iter 1941712.147222082 ns/iter 1.52
JSONLD_Catalog_Annotation_List_Populate 1180854.8715751772 ns/iter 1323397.619047509 ns/iter 0.89
JSONLD_Catalog_Materialize 6068295.401709657 ns/iter 6521135.605504417 ns/iter 0.93
JSONL_Parse_Large 12164369.186439987 ns/iter 13867017.619998023 ns/iter 0.88
JSONL_Parse_Large_GZIP 13866582.849056253 ns/iter 15205829.391304534 ns/iter 0.91
URITemplateRouter_Create 26963.08172109801 ns/iter 29829.990197743988 ns/iter 0.90
URITemplateRouter_Match 164.98542258616686 ns/iter 154.54511704474015 ns/iter 1.07
URITemplateRouter_Match_BasePath 185.55448825003097 ns/iter 180.9371915566876 ns/iter 1.03
URITemplateRouterView_Restore 3455.823735846882 ns/iter 8437.559231577285 ns/iter 0.41
URITemplateRouterView_Match 116.53997236488023 ns/iter 124.37209895760992 ns/iter 0.94
URITemplateRouterView_Match_BasePath 129.8044671504573 ns/iter 141.35522721158426 ns/iter 0.92
URITemplateRouterView_Arguments 443.537100452559 ns/iter 477.4469192963429 ns/iter 0.93
JSONPath_Descendant_Filter_Nested 1369.3262566290935 ns/iter
Pointer_Object_Traverse 27.954956985317544 ns/iter 30.41662823010879 ns/iter 0.92
Pointer_Object_Try_Traverse 25.72792826946374 ns/iter 22.696827920370648 ns/iter 1.13
Pointer_Push_Back_Pointer_To_Weak_Pointer 147.48487444045662 ns/iter 157.10689868493048 ns/iter 0.94
Pointer_Walker_Schema_ISO_Language 2423197.9895104747 ns/iter 2620893.794007285 ns/iter 0.92
Pointer_Maybe_Tracked_Deeply_Nested/0 1946486.2689076092 ns/iter 1831648.7085562488 ns/iter 1.06
Pointer_Maybe_Tracked_Deeply_Nested/1 1750684.3407408055 ns/iter 1709943.2652068366 ns/iter 1.02
Pointer_Position_Tracker_Get_Deeply_Nested 474.6071369361487 ns/iter 509.8274588177563 ns/iter 0.93
JSON_Array_Of_Objects_Unique 411.0460161165234 ns/iter 443.0882052879491 ns/iter 0.93
JSON_Parse_1 9001.06032853136 ns/iter 9695.33845302342 ns/iter 0.93
JSON_Parse_Real 6968.390709179446 ns/iter 7727.671386848116 ns/iter 0.90
JSON_Parse_Decimal 10056.1802832474 ns/iter 12618.784756922601 ns/iter 0.80
JSON_Parse_Schema_ISO_Language 6170785.08849547 ns/iter 6501374.9813090805 ns/iter 0.95
JSON_Parse_Integer 4734.824039141905 ns/iter 5769.3515884055205 ns/iter 0.82
JSON_Parse_String_NonSSO_Plain 10426.776323714956 ns/iter 12199.379881554045 ns/iter 0.85
JSON_Parse_String_SSO_Plain 4491.0368621570415 ns/iter 5158.52145064081 ns/iter 0.87
JSON_Parse_String_Escape_Heavy 23584.496503729384 ns/iter 26220.52198502003 ns/iter 0.90
JSON_Parse_Object_Short_Keys 11969.775687384565 ns/iter 13474.275850797065 ns/iter 0.89
JSON_Parse_Object_Scalar_Properties 6189.013962666256 ns/iter 6968.293349015295 ns/iter 0.89
JSON_Parse_Object_Array_Properties 11232.376245541176 ns/iter 11318.759698535996 ns/iter 0.99
JSON_Parse_Object_Object_Properties 11077.926688803218 ns/iter 11638.000149549855 ns/iter 0.95
JSON_Parse_Nested_Containers 94672.11226554049 ns/iter 95831.52166188446 ns/iter 0.99
JSON_From_String_Copy 18.143764637326004 ns/iter 17.497905250483495 ns/iter 1.04
JSON_From_String_Temporary 14.561707706334504 ns/iter 15.10910001442845 ns/iter 0.96
JSON_Number_To_Double 24.635753926116113 ns/iter 20.872135905452456 ns/iter 1.18
JSON_Object_At_Last_Key/8 6.556303948424308 ns/iter 5.920808070390107 ns/iter 1.11
JSON_Object_At_Last_Key/32 21.59545739004529 ns/iter 21.81969650564531 ns/iter 0.99
JSON_Object_At_Last_Key/128 80.15799574989353 ns/iter 87.62233196298116 ns/iter 0.91
JSON_Object_At_Last_Key/512 272.28541058002213 ns/iter 399.81387217916233 ns/iter 0.68
JSON_Fast_Hash_Helm_Chart_Lock 73.9814983784438 ns/iter 62.20543491661206 ns/iter 1.19
JSON_Equality_Helm_Chart_Lock 133.2417161017348 ns/iter 176.16695401039286 ns/iter 0.76
JSON_Divisible_By_Decimal 240.98364254768177 ns/iter 243.59376252519735 ns/iter 0.99
JSON_String_Equal/10 5.084696166971398 ns/iter 6.040855182122646 ns/iter 0.84
JSON_String_Equal/100 6.345737631670489 ns/iter 6.661027859260404 ns/iter 0.95
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9404235156503411 ns/iter 0.7429158231296288 ns/iter 1.27
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 17.17385559053495 ns/iter 25.1990372003541 ns/iter 0.68
JSON_String_Fast_Hash/10 3.416314120514001 ns/iter 2.2634882380135366 ns/iter 1.51
JSON_String_Fast_Hash/100 3.471652143237003 ns/iter 2.263454850395587 ns/iter 1.53
JSON_String_Key_Hash/10 1.6465789267334778 ns/iter 1.3086887526143922 ns/iter 1.26
JSON_String_Key_Hash/100 12.912094116821356 ns/iter 12.444532688889721 ns/iter 1.04
JSON_Object_Defines_Miss_Same_Length 2.9290839266067543 ns/iter 3.1298926118005763 ns/iter 0.94
JSON_Object_Defines_Miss_Too_Small 3.239630675378501 ns/iter 3.1140454941425717 ns/iter 1.04
JSON_Object_Defines_Miss_Too_Large 3.4353761838463495 ns/iter 3.4334306573332656 ns/iter 1.00
Regex_Lower_S_Or_Upper_S_Asterisk 0.9796126958030947 ns/iter 0.6232966958857146 ns/iter 1.57
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 0.9696115485351713 ns/iter 0.9337913115544187 ns/iter 1.04
Regex_Period_Asterisk 0.9764420357561364 ns/iter 0.6229466237204659 ns/iter 1.57
Regex_Group_Period_Asterisk_Group 0.9765759944046768 ns/iter 0.9344651111915826 ns/iter 1.05
Regex_Period_Plus 0.9977095099789747 ns/iter 0.6230805670707861 ns/iter 1.60
Regex_Period 0.9658361763376062 ns/iter 0.9341197336514954 ns/iter 1.03
Regex_Caret_Period_Plus_Dollar 0.9955544259839909 ns/iter 0.6228090512690905 ns/iter 1.60
Regex_Caret_Group_Period_Plus_Group_Dollar 0.9791664975403589 ns/iter 0.9346853454677259 ns/iter 1.05
Regex_Caret_Period_Asterisk_Dollar 0.9686815123408711 ns/iter 0.6231080969449737 ns/iter 1.55
Regex_Caret_Group_Period_Asterisk_Group_Dollar 0.9753502873713312 ns/iter 0.9439765431526057 ns/iter 1.03
Regex_Caret_X_Hyphen 3.2480064567852516 ns/iter 3.742700759962172 ns/iter 0.87
Regex_Period_Md_Dollar 24.08514803180298 ns/iter 30.18369199818633 ns/iter 0.80
Regex_Caret_Slash_Period_Asterisk 3.3089640390465833 ns/iter 4.050475149510784 ns/iter 0.82
Regex_Caret_Period_Range_Dollar 1.66404368761971 ns/iter 1.5878910341260812 ns/iter 1.05
Regex_Nested_Backtrack 36.24133860400495 ns/iter 41.05771913979526 ns/iter 0.88

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: dfb000d Previous: af1b297 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.4641143214888106 ns/iter 2.196737339619877 ns/iter 1.12
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.4631601746244374 ns/iter 2.182734856286784 ns/iter 1.13
Regex_Period_Asterisk 2.464060609465493 ns/iter 2.4585583289218014 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 2.462670416931227 ns/iter 2.454872086301719 ns/iter 1.00
Regex_Period_Plus 4.2182624746706185 ns/iter 3.273039690570853 ns/iter 1.29
Regex_Period 4.220582813250698 ns/iter 3.2752223154723574 ns/iter 1.29
Regex_Caret_Period_Plus_Dollar 3.8673563927795667 ns/iter 3.5502059787237776 ns/iter 1.09
Regex_Caret_Group_Period_Plus_Group_Dollar 3.867686121454208 ns/iter 3.5480007167100496 ns/iter 1.09
Regex_Caret_Period_Asterisk_Dollar 2.8131034151223306 ns/iter 2.4627321581563826 ns/iter 1.14
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.813586610076039 ns/iter 2.4604938688058957 ns/iter 1.14
Regex_Caret_X_Hyphen 6.681764431949329 ns/iter 6.010228045210963 ns/iter 1.11
Regex_Period_Md_Dollar 26.395833323907084 ns/iter 20.484079535627707 ns/iter 1.29
Regex_Caret_Slash_Period_Asterisk 7.388028848736539 ns/iter 5.73522432059186 ns/iter 1.29
Regex_Caret_Period_Range_Dollar 4.223617240163753 ns/iter 2.45499208993446 ns/iter 1.72
Regex_Nested_Backtrack 38.493221443242106 ns/iter 29.934592762167348 ns/iter 1.29
JSON_Array_Of_Objects_Unique 436.6476840418736 ns/iter 324.0204782616417 ns/iter 1.35
JSON_Parse_1 4691.149281129518 ns/iter 3698.8916338153376 ns/iter 1.27
JSON_Parse_Real 5164.017490499288 ns/iter 4061.3648307524295 ns/iter 1.27
JSON_Parse_Decimal 7593.91117569034 ns/iter 6716.554996019025 ns/iter 1.13
JSON_Parse_Schema_ISO_Language 3527225.236181112 ns/iter 2914005.851851942 ns/iter 1.21
JSON_Parse_Integer 3933.739994492443 ns/iter 3038.6032992899495 ns/iter 1.29
JSON_Parse_String_NonSSO_Plain 5008.0368960469705 ns/iter 3917.450641173127 ns/iter 1.28
JSON_Parse_String_SSO_Plain 2765.4245475612265 ns/iter 2275.1798313593185 ns/iter 1.22
JSON_Parse_String_Escape_Heavy 14547.92490019842 ns/iter 11701.304651513694 ns/iter 1.24
JSON_Parse_Object_Short_Keys 7980.297984353721 ns/iter 6500.707458128851 ns/iter 1.23
JSON_Parse_Object_Scalar_Properties 4082.2923098457277 ns/iter 3336.9342850603116 ns/iter 1.22
JSON_Parse_Object_Array_Properties 5466.334629501584 ns/iter 4756.913059470589 ns/iter 1.15
JSON_Parse_Object_Object_Properties 5447.519557287617 ns/iter 4723.506961418596 ns/iter 1.15
JSON_Parse_Nested_Containers 45033.82269640191 ns/iter 35335.77540213695 ns/iter 1.27
JSON_From_String_Copy 20.412514031642267 ns/iter 18.28563241157559 ns/iter 1.12
JSON_From_String_Temporary 18.30085708471468 ns/iter 16.133099535580193 ns/iter 1.13
JSON_Number_To_Double 22.811745851638914 ns/iter 17.403790960456316 ns/iter 1.31
JSON_Object_At_Last_Key/8 6.334601905855965 ns/iter 3.114735510676425 ns/iter 2.03
JSON_Object_At_Last_Key/32 23.581449190333643 ns/iter 10.17707287916053 ns/iter 2.32
JSON_Object_At_Last_Key/128 91.06510087661941 ns/iter 37.38627213052234 ns/iter 2.44
JSON_Object_At_Last_Key/512 380.8111854913547 ns/iter 286.22760715637884 ns/iter 1.33
JSON_Fast_Hash_Helm_Chart_Lock 72.80310228731355 ns/iter 54.27242886291151 ns/iter 1.34
JSON_Equality_Helm_Chart_Lock 159.62776694446907 ns/iter 122.23781408963434 ns/iter 1.31
JSON_Divisible_By_Decimal 261.49117181255707 ns/iter 195.97431035797356 ns/iter 1.33
JSON_String_Equal/10 5.626589098409454 ns/iter 4.3672938314000005 ns/iter 1.29
JSON_String_Equal/100 6.331830855063645 ns/iter 5.188063911770155 ns/iter 1.22
JSON_String_Equal_Small_By_Perfect_Hash/10 1.054171838100029 ns/iter 0.8195408060083677 ns/iter 1.29
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 12.316510440635117 ns/iter 9.570923590082495 ns/iter 1.29
JSON_String_Fast_Hash/10 2.4633392974938473 ns/iter 1.911657705173844 ns/iter 1.29
JSON_String_Fast_Hash/100 2.4630735672378017 ns/iter 1.9106217663600666 ns/iter 1.29
JSON_String_Key_Hash/10 2.8134946108500682 ns/iter 1.9104143319040208 ns/iter 1.47
JSON_String_Key_Hash/100 7.732476157467536 ns/iter 6.002376057636688 ns/iter 1.29
JSON_Object_Defines_Miss_Same_Length 2.951381489413252 ns/iter 2.3012647217280424 ns/iter 1.28
JSON_Object_Defines_Miss_Too_Small 3.012441393550473 ns/iter 2.2899465745061387 ns/iter 1.32
JSON_Object_Defines_Miss_Too_Large 3.20893448239204 ns/iter 3.2751954904995952 ns/iter 0.98
Pointer_Object_Traverse 30.588865955605726 ns/iter 23.797011583247354 ns/iter 1.29
Pointer_Object_Try_Traverse 32.97157442833154 ns/iter 25.59678396274033 ns/iter 1.29
Pointer_Push_Back_Pointer_To_Weak_Pointer 165.31578367844864 ns/iter 151.88883617903423 ns/iter 1.09
Pointer_Walker_Schema_ISO_Language 2772039.7698414805 ns/iter 2197996.074999864 ns/iter 1.26
Pointer_Maybe_Tracked_Deeply_Nested/0 1261925.14963505 ns/iter 1004276.9344978546 ns/iter 1.26
Pointer_Maybe_Tracked_Deeply_Nested/1 1577145.004524704 ns/iter 1351787.6737451705 ns/iter 1.17
Pointer_Position_Tracker_Get_Deeply_Nested 696.4567555418436 ns/iter 571.606583319941 ns/iter 1.22
JSONPath_Descendant_Filter_Nested 1591.0380301094967 ns/iter
URITemplateRouter_Create 30587.38200904967 ns/iter 23661.556856955256 ns/iter 1.29
URITemplateRouter_Match 182.12881005757424 ns/iter 127.76269336407131 ns/iter 1.43
URITemplateRouter_Match_BasePath 213.72953041985375 ns/iter 150.65284445728423 ns/iter 1.42
URITemplateRouterView_Restore 9960.99375233165 ns/iter 7670.92674980541 ns/iter 1.30
URITemplateRouterView_Match 146.05588464223698 ns/iter 108.00410604657414 ns/iter 1.35
URITemplateRouterView_Match_BasePath 165.5176724108746 ns/iter 120.71325790124523 ns/iter 1.37
URITemplateRouterView_Arguments 457.16450957616024 ns/iter 352.5074940072145 ns/iter 1.30
JSONL_Parse_Large 9369396.520000918 ns/iter 7272751.9270839505 ns/iter 1.29
JSONL_Parse_Large_GZIP 11113884.999998743 ns/iter 8590967.444445001 ns/iter 1.29
JSONLD_Catalog_Annotation_List_Populate 1327922.535055318 ns/iter 988905.4360794347 ns/iter 1.34
JSONLD_Catalog_Materialize 4412798.4402512545 ns/iter 3330247.2333335094 ns/iter 1.33
HTML_Build_Table_100000 70193850.40000543 ns/iter 52109707.15384415 ns/iter 1.35
HTML_Render_Table_100000 5485722.920000626 ns/iter 4426500.961783273 ns/iter 1.24
GZIP_Compress_ISO_Language_Set_3_Locations 35572831.150000185 ns/iter 27367606.50000091 ns/iter 1.30
GZIP_Decompress_ISO_Language_Set_3_Locations 4277223.50306733 ns/iter 2914234.6317991256 ns/iter 1.47
GZIP_Compress_ISO_Language_Set_3_Schema 2129266.3292685836 ns/iter 1623006.4513888676 ns/iter 1.31
GZIP_Decompress_ISO_Language_Set_3_Schema 277280.6720791904 ns/iter 195740.70095025777 ns/iter 1.42
JOSE_VerifySignature_RS256 63916.73307755321 ns/iter 50099.91900000159 ns/iter 1.28
JOSE_VerifySignature_ES512 2723980.0658913883 ns/iter 2183104.021874982 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 (windows/msvc)

Details
Benchmark suite Current: dfb000d Previous: af1b297 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 5.342134999999644 ns/iter 5.0375450000001365 ns/iter 1.06
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 5.035958304695466 ns/iter 5.354448000000502 ns/iter 0.94
Regex_Period_Asterisk 5.038924107143065 ns/iter 5.536918000000242 ns/iter 0.91
Regex_Group_Period_Asterisk_Group 5.03802999999948 ns/iter 5.592267857143237 ns/iter 0.90
Regex_Period_Plus 4.8023959928624596 ns/iter 5.976482999999461 ns/iter 0.80
Regex_Period 5.180861999999706 ns/iter 5.48033839285722 ns/iter 0.95
Regex_Caret_Period_Plus_Dollar 4.8704875010868385 ns/iter 6.028099000000111 ns/iter 0.81
Regex_Caret_Group_Period_Plus_Group_Dollar 5.048151785714034 ns/iter 5.026734000000488 ns/iter 1.00
Regex_Caret_Period_Asterisk_Dollar 5.342963392856908 ns/iter 5.093484755601065 ns/iter 1.05
Regex_Caret_Group_Period_Asterisk_Group_Dollar 5.029990178571658 ns/iter 5.353030999999646 ns/iter 0.94
Regex_Caret_X_Hyphen 8.810540585667663 ns/iter 8.15520982142865 ns/iter 1.08
Regex_Period_Md_Dollar 44.84907571563832 ns/iter 44.99737705359346 ns/iter 1.00
Regex_Caret_Slash_Period_Asterisk 8.186300223214412 ns/iter 8.300506696427489 ns/iter 0.99
Regex_Caret_Period_Range_Dollar 5.990581999999449 ns/iter 5.684544642856996 ns/iter 1.05
Regex_Nested_Backtrack 55.680544642860184 ns/iter 56.98228571428591 ns/iter 0.98
JSON_Array_Of_Objects_Unique 603.0193750000024 ns/iter 614.6612499999752 ns/iter 0.98
JSON_Parse_1 8773.62556417103 ns/iter 8827.917286083857 ns/iter 0.99
JSON_Parse_Real 15979.343750000144 ns/iter 16219.564732143763 ns/iter 0.99
JSON_Parse_Decimal 12409.329687500303 ns/iter 11929.057142858872 ns/iter 1.04
JSON_Parse_Schema_ISO_Language 7626506.666666602 ns/iter 7722403.33333482 ns/iter 0.99
JSON_Parse_Integer 6251.884821427974 ns/iter 6147.621428571678 ns/iter 1.02
JSON_Parse_String_NonSSO_Plain 7679.559151786261 ns/iter 7978.620535715107 ns/iter 0.96
JSON_Parse_String_SSO_Plain 3552.723487006309 ns/iter 3739.912785870201 ns/iter 0.95
JSON_Parse_String_Escape_Heavy 21989.25625000214 ns/iter 21843.47499999717 ns/iter 1.01
JSON_Parse_Object_Short_Keys 13445.118325365824 ns/iter 13310.067857141965 ns/iter 1.01
JSON_Parse_Object_Scalar_Properties 6927.784821428419 ns/iter 6843.034821427198 ns/iter 1.01
JSON_Parse_Object_Array_Properties 11344.984375000422 ns/iter 11428.942857142893 ns/iter 0.99
JSON_Parse_Object_Object_Properties 11535.903571427752 ns/iter 11571.403571427449 ns/iter 1.00
JSON_Parse_Nested_Containers 77721.84151785108 ns/iter 79940.64732140975 ns/iter 0.97
JSON_From_String_Copy 65.62622321429298 ns/iter 64.24342857142408 ns/iter 1.02
JSON_From_String_Temporary 62.233187500006736 ns/iter 58.1533214285709 ns/iter 1.07
JSON_Number_To_Double 120.24987499998474 ns/iter 122.88541071427518 ns/iter 0.98
JSON_Object_At_Last_Key/8 7.249556919642432 ns/iter 7.289108928570645 ns/iter 0.99
JSON_Object_At_Last_Key/32 23.269021428571286 ns/iter 23.049130323108187 ns/iter 1.01
JSON_Object_At_Last_Key/128 89.53916118129263 ns/iter 92.65151372092295 ns/iter 0.97
JSON_Object_At_Last_Key/512 424.0683943856646 ns/iter 424.87544138683154 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 106.12274526236456 ns/iter 103.38386592035117 ns/iter 1.03
JSON_Equality_Helm_Chart_Lock 257.8311562499991 ns/iter 225.2462360216403 ns/iter 1.14
JSON_Divisible_By_Decimal 347.34885315196505 ns/iter 303.15264250530356 ns/iter 1.15
JSON_String_Equal/10 12.601295702673266 ns/iter 10.871685937502207 ns/iter 1.16
JSON_String_Equal/100 13.208768749999322 ns/iter 12.249466071429945 ns/iter 1.08
JSON_String_Equal_Small_By_Perfect_Hash/10 2.5069965373804775 ns/iter 2.5139864285717652 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.223654177574227 ns/iter 15.08086160714279 ns/iter 0.94
JSON_String_Fast_Hash/10 6.579511160714598 ns/iter 6.9727968749993305 ns/iter 0.94
JSON_String_Fast_Hash/100 6.590615178571926 ns/iter 7.06986272321432 ns/iter 0.93
JSON_String_Key_Hash/10 5.3269509999995535 ns/iter 5.412521000000652 ns/iter 0.98
JSON_String_Key_Hash/100 11.873151785715256 ns/iter 11.938079687499936 ns/iter 0.99
JSON_Object_Defines_Miss_Same_Length 3.940765171534399 ns/iter 4.098397418032084 ns/iter 0.96
JSON_Object_Defines_Miss_Too_Small 4.082783489433399 ns/iter 4.434193125000263 ns/iter 0.92
JSON_Object_Defines_Miss_Too_Large 3.7694266004117183 ns/iter 4.103912609775081 ns/iter 0.92
Pointer_Object_Traverse 71.14203571427018 ns/iter 70.32682142857588 ns/iter 1.01
Pointer_Object_Try_Traverse 74.02574999998382 ns/iter 71.66068080357897 ns/iter 1.03
Pointer_Push_Back_Pointer_To_Weak_Pointer 185.73272194041022 ns/iter 189.12374010030584 ns/iter 0.98
Pointer_Walker_Schema_ISO_Language 11061039.062500555 ns/iter 11719998.2142852 ns/iter 0.94
Pointer_Maybe_Tracked_Deeply_Nested/0 2518805.2208840046 ns/iter 2458013.636363672 ns/iter 1.02
Pointer_Maybe_Tracked_Deeply_Nested/1 3802476.5363124516 ns/iter 3792421.7877099696 ns/iter 1.00
Pointer_Position_Tracker_Get_Deeply_Nested 560.4391741069747 ns/iter 522.7963262326101 ns/iter 1.07
JSONPath_Descendant_Filter_Nested 2378.044285714103 ns/iter
URITemplateRouter_Create 41055.51738685365 ns/iter 41027.24040258331 ns/iter 1.00
URITemplateRouter_Match 235.80814332498935 ns/iter 233.89858996669037 ns/iter 1.01
URITemplateRouter_Match_BasePath 280.3606749838873 ns/iter 267.04860714281557 ns/iter 1.05
URITemplateRouterView_Restore 33122.009428408535 ns/iter 32493.758928576914 ns/iter 1.02
URITemplateRouterView_Match 177.9736230333541 ns/iter 184.16088286792123 ns/iter 0.97
URITemplateRouterView_Match_BasePath 202.92859808353913 ns/iter 207.2937831565095 ns/iter 0.98
URITemplateRouterView_Arguments 564.93660000001 ns/iter 542.2379464284128 ns/iter 1.04
JSONL_Parse_Large 32550152.380952653 ns/iter 33391266.666664403 ns/iter 0.97
JSONL_Parse_Large_GZIP 34324533.333336234 ns/iter 33918854.999990344 ns/iter 1.01
JSONLD_Catalog_Annotation_List_Populate 2739562.6506026327 ns/iter 2716229.7188756 ns/iter 1.01
JSONLD_Catalog_Materialize 9942729.687498542 ns/iter 8628603.999998935 ns/iter 1.15
HTML_Build_Table_100000 89632957.14287207 ns/iter 87877511.1110978 ns/iter 1.02
HTML_Render_Table_100000 8215156.66666528 ns/iter 7377740.178571099 ns/iter 1.11
GZIP_Compress_ISO_Language_Set_3_Locations 36434384.21052355 ns/iter 37215899.99999627 ns/iter 0.98
GZIP_Decompress_ISO_Language_Set_3_Locations 10149187.499997936 ns/iter 10016829.333332377 ns/iter 1.01
GZIP_Compress_ISO_Language_Set_3_Schema 2103210.9374999665 ns/iter 2144012.173912547 ns/iter 0.98
GZIP_Decompress_ISO_Language_Set_3_Schema 635324.2857142861 ns/iter 607067.6785715331 ns/iter 1.05
JOSE_VerifySignature_RS256 21424.703125006774 ns/iter 21522.05617781964 ns/iter 1.00
JOSE_VerifySignature_ES512 1552209.3749998435 ns/iter 1542641.9642860114 ns/iter 1.01

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

@jviotti jviotti force-pushed the jsonpath branch 4 times, most recently from a469d03 to fc88f0a Compare July 10, 2026 13:43
@jviotti jviotti changed the title [WIP] Prototype a simple JSON Path implementation Prototype a simple JSON Path implementation Jul 10, 2026
@jviotti jviotti marked this pull request as ready for review July 10, 2026 14:32
@augmentcode

augmentcode Bot commented Jul 10, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Introduces a prototype RFC 9535 JSONPath implementation as a new optional Core component.

Changes:

  • Adds a new sourcemeta::core::JSONPath API with parsing, evaluation, filter support, and path normalization.
  • Implements a dedicated JSONPath parser and evaluator (including descendant traversal, unions, slices, and basic filter expressions/functions).
  • Adds a JSONPath parse error type (JSONPathParseError) for column-accurate failure reporting.
  • Wires JSONPath into top-level CMake options, packaging config, and the “find_package” sample.
  • Adds unit tests for parsing, evaluation, filters, normalization, plus a runner for the JSONPath compliance test suite.
  • Adds a benchmark exercising descendant + filter + regex matching.

Technical Notes: JSONPath depends on existing Core JSON/JSON Pointer/Regex facilities and is gated behind SOURCEMETA_CORE_JSONPATH to keep builds modular.

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

Fix All in Augment

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

Comment thread src/core/jsonpath/jsonpath.cc Outdated
Comment thread src/core/jsonpath/parser.h

@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/jsonpath/include/sourcemeta/core/jsonpath_error.h
Comment thread src/core/jsonpath/parser.h Outdated
Comment thread src/core/jsonpath/jsonpath.cc Outdated
Comment thread src/core/jsonpath/jsonpath.cc Outdated

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

2 issues found across 5 files (changes from recent commits).

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="test/jsonpath/jsonpath_filter_test.cc">

<violation number="1" location="test/jsonpath/jsonpath_filter_test.cc:299">
P3: Test name says 'less_than' but the filter uses `>` (greater than). The name suggests the test exercises `<` behavior, making it harder to find or understand what's being tested.</violation>

<violation number="2" location="test/jsonpath/jsonpath_filter_test.cc:307">
P3: Test name says 'less_than' but the filter uses `>` (greater than). The previous naming convention in this file correctly uses `less_than` for `<` tests; this name is misleading.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread test/jsonpath/jsonpath_filter_test.cc Outdated
Comment thread test/jsonpath/jsonpath_filter_test.cc Outdated
jviotti added 10 commits July 10, 2026 12:20
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>
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>
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>
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>

@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 across 2 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread src/core/jsonpath/jsonpath.cc
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>

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

2 issues found across 5 files (changes from recent commits).

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="src/core/jsonpath/include/sourcemeta/core/jsonpath.h">

<violation number="1" location="src/core/jsonpath/include/sourcemeta/core/jsonpath.h:231">
P3: Index-only segments are still evaluated through the general selector path because no dispatch reads `SegmentKind::SingleIndex`. Until an index fast path is added, classifying indexes as `General` (or dropping this enum value) would avoid unused precomputed state that looks like an implemented optimization.</violation>
</file>

<file name="src/core/jsonpath/jsonpath.cc">

<violation number="1" location="src/core/jsonpath/jsonpath.cc:1243">
P1: Deep descendant queries can still exhaust the machine stack despite the new iterative fallback, because `evaluate_descendant` recurses into children without checking `JSONPATH_EVALUATION_RECURSION_LIMIT`. Adding the same threshold handoff at the start of `evaluate_descendant` would make `$..` traversal switch to `evaluate_query` before the stack grows unbounded.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread src/core/jsonpath/jsonpath.cc
/// A single name selector applied to children
SingleName,
/// A single index selector applied to children
SingleIndex,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: Index-only segments are still evaluated through the general selector path because no dispatch reads SegmentKind::SingleIndex. Until an index fast path is added, classifying indexes as General (or dropping this enum value) would avoid unused precomputed state that looks like an implemented optimization.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/core/jsonpath/include/sourcemeta/core/jsonpath.h, line 231:

<comment>Index-only segments are still evaluated through the general selector path because no dispatch reads `SegmentKind::SingleIndex`. Until an index fast path is added, classifying indexes as `General` (or dropping this enum value) would avoid unused precomputed state that looks like an implemented optimization.</comment>

<file context>
@@ -223,10 +223,22 @@ class SOURCEMETA_CORE_JSONPATH_EXPORT JSONPath {
+    /// A single name selector applied to children
+    SingleName,
+    /// A single index selector applied to children
+    SingleIndex,
+    /// Any other combination of selectors
+    General
</file context>

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti merged commit b6461e6 into main Jul 10, 2026
12 checks passed
@jviotti jviotti deleted the jsonpath branch July 10, 2026 16:42
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