Skip to content

Commit

Permalink
Don't consider exhausive evaluation on LogicalNot (#1291)
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti authored Oct 11, 2024
1 parent 9210087 commit 5afe305
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/evaluator/evaluator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -645,9 +645,7 @@ auto evaluate_step(
for (const auto &child : logical.children) {
if (!evaluate_step(child, callback, context)) {
result = true;
if (!logical.exhaustive) {
break;
}
break;
}
}

Expand Down

8 comments on commit 5afe305

@github-actions
Copy link

Choose a reason for hiding this comment

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

Benchmark (linux/llvm)

Benchmark suite Current: 5afe305 Previous: 9210087 Ratio
JSON_Array_Of_Objects_Unique 2118.748205350983 ns/iter 2105.1106745487705 ns/iter 1.01
JSONSchema_Validate_Draft4_Meta_1_No_Callback 1024.686902048728 ns/iter 1018.5094102704204 ns/iter 1.01
JSONSchema_Validate_Draft4_Required_Properties 1667.2276952895122 ns/iter 1659.8907280490973 ns/iter 1.00
JSONSchema_Validate_Draft4_Many_Optional_Properties_Minimal_Match 181.43617658291055 ns/iter 183.3500397405002 ns/iter 0.99
JSONSchema_Validate_Draft4_Few_Optional_Properties_Minimal_Match 130.2021838202546 ns/iter 131.63353163428425 ns/iter 0.99
JSONSchema_Validate_Draft4_Items_Schema 3805.263500244285 ns/iter 3793.4469468819834 ns/iter 1.00
JSONSchema_Validate_Draft4_Nested_Object 32.24451011579385 ns/iter 32.52067729852961 ns/iter 0.99
JSONSchema_Validate_Draft4_Properties_Triad_Optional 1802.3824136972846 ns/iter 1804.0293375379326 ns/iter 1.00
JSONSchema_Validate_Draft4_Properties_Triad_Closed 1503.1280126789916 ns/iter 1507.6647223422817 ns/iter 1.00
JSONSchema_Validate_Draft4_Properties_Triad_Required 1887.6695791716525 ns/iter 1887.468363516614 ns/iter 1.00
JSONSchema_Validate_Draft4_Non_Recursive_Ref 477.7836797819292 ns/iter 481.93936483761297 ns/iter 0.99
JSONSchema_Validate_Draft4_Pattern_Properties_True 2442.2766912016245 ns/iter 2470.271941343755 ns/iter 0.99
JSONSchema_Validate_Draft4_Ref_To_Single_Property 135.47460564715678 ns/iter 137.68855208236334 ns/iter 0.98
JSONSchema_Validate_Draft4_Additional_Properties_Type 598.0328807417822 ns/iter 605.2190895614962 ns/iter 0.99
JSONSchema_Validate_Draft4_Nested_Oneof 518.6461448229502 ns/iter 518.2994117881791 ns/iter 1.00
JSONSchema_Validate_Draft6_Property_Names 1289.4409899097393 ns/iter 1285.8222314491036 ns/iter 1.00
JSONSchema_Validate_Draft7_If_Then_Else 222.1619993146715 ns/iter 223.12060945227495 ns/iter 1.00
JSONSchema_Compiler_Draft6_AdaptiveCard 5717623537.999998 ns/iter 5621398539.999973 ns/iter 1.02

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

@github-actions
Copy link

Choose a reason for hiding this comment

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

Benchmark (macos/llvm)

Benchmark suite Current: 5afe305 Previous: 9210087 Ratio
JSON_Array_Of_Objects_Unique 4008.1294234544694 ns/iter 3551.688752013014 ns/iter 1.13
JSONSchema_Validate_Draft4_Meta_1_No_Callback 831.302096432552 ns/iter 744.0397844911156 ns/iter 1.12
JSONSchema_Validate_Draft4_Required_Properties 1063.6144055040247 ns/iter 937.3785880619843 ns/iter 1.13
JSONSchema_Validate_Draft4_Many_Optional_Properties_Minimal_Match 195.50810020038 ns/iter 150.5257586176018 ns/iter 1.30
JSONSchema_Validate_Draft4_Few_Optional_Properties_Minimal_Match 127.32264892292032 ns/iter 103.17953288754978 ns/iter 1.23
JSONSchema_Validate_Draft4_Items_Schema 3069.2993686638374 ns/iter 2621.7340463275395 ns/iter 1.17
JSONSchema_Validate_Draft4_Nested_Object 25.684004030680935 ns/iter 22.88607193912936 ns/iter 1.12
JSONSchema_Validate_Draft4_Properties_Triad_Optional 1473.2491053346844 ns/iter 1346.6142793359759 ns/iter 1.09
JSONSchema_Validate_Draft4_Properties_Triad_Closed 1091.5889940283591 ns/iter 1044.5586643214917 ns/iter 1.05
JSONSchema_Validate_Draft4_Properties_Triad_Required 1568.6015840057155 ns/iter 1325.172184592178 ns/iter 1.18
JSONSchema_Validate_Draft4_Non_Recursive_Ref 244.84848041496053 ns/iter 212.35822183661762 ns/iter 1.15
JSONSchema_Validate_Draft4_Pattern_Properties_True 1519.8101297979056 ns/iter 1356.5620734564156 ns/iter 1.12
JSONSchema_Validate_Draft4_Ref_To_Single_Property 149.53067588474977 ns/iter 105.39928281431875 ns/iter 1.42
JSONSchema_Validate_Draft4_Additional_Properties_Type 499.2028887454913 ns/iter 404.6109611596966 ns/iter 1.23
JSONSchema_Validate_Draft4_Nested_Oneof 413.47871655219967 ns/iter 365.12705530099447 ns/iter 1.13
JSONSchema_Validate_Draft6_Property_Names 853.380414189511 ns/iter 775.7710895558438 ns/iter 1.10
JSONSchema_Validate_Draft7_If_Then_Else 183.79326281877465 ns/iter 168.23663315801025 ns/iter 1.09
JSONSchema_Compiler_Draft6_AdaptiveCard 3585877875.000051 ns/iter 2889689000.0000896 ns/iter 1.24

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

@github-actions
Copy link

Choose a reason for hiding this comment

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

Benchmark (windows/msvc)

Benchmark suite Current: 5afe305 Previous: 9210087 Ratio
JSON_Array_Of_Objects_Unique 5218.323214285599 ns/iter 5036.791999998513 ns/iter 1.04
JSONSchema_Validate_Draft4_Meta_1_No_Callback 2261.10843750007 ns/iter 2253.7113239828936 ns/iter 1.00
JSONSchema_Validate_Draft4_Required_Properties 2052.74093750063 ns/iter 1971.9620285375267 ns/iter 1.04
JSONSchema_Validate_Draft4_Many_Optional_Properties_Minimal_Match 552.9687499999015 ns/iter 550.6456249999507 ns/iter 1.00
JSONSchema_Validate_Draft4_Few_Optional_Properties_Minimal_Match 416.0178127705947 ns/iter 412.3636958765714 ns/iter 1.01
JSONSchema_Validate_Draft4_Items_Schema 6347.525892857268 ns/iter 6249.376785713625 ns/iter 1.02
JSONSchema_Validate_Draft4_Nested_Object 159.30734374996243 ns/iter 158.38044642860285 ns/iter 1.01
JSONSchema_Validate_Draft4_Properties_Triad_Optional 5415.5470000000605 ns/iter 5435.3249999995305 ns/iter 1.00
JSONSchema_Validate_Draft4_Properties_Triad_Closed 4442.9043972474965 ns/iter 4442.613750380717 ns/iter 1.00
JSONSchema_Validate_Draft4_Properties_Triad_Required 5500.774107141687 ns/iter 5472.563392856956 ns/iter 1.01
JSONSchema_Validate_Draft4_Non_Recursive_Ref 546.6128000000481 ns/iter 537.1533 ns/iter 1.02
JSONSchema_Validate_Draft4_Pattern_Properties_True 7975.459038129684 ns/iter 8141.960937498384 ns/iter 0.98
JSONSchema_Validate_Draft4_Ref_To_Single_Property 420.5714116963395 ns/iter 414.8811608072706 ns/iter 1.01
JSONSchema_Validate_Draft4_Additional_Properties_Type 751.7927455357969 ns/iter 735.3123883928297 ns/iter 1.02
JSONSchema_Validate_Draft4_Nested_Oneof 1069.1479687501726 ns/iter 1083.7001562499893 ns/iter 0.99
JSONSchema_Validate_Draft6_Property_Names 1974.7857754299428 ns/iter 1873.808743089966 ns/iter 1.05
JSONSchema_Validate_Draft7_If_Then_Else 550.3839000000426 ns/iter 550.1916071427867 ns/iter 1.00
JSONSchema_Compiler_Draft6_AdaptiveCard 9933251799.99988 ns/iter 10186974299.999975 ns/iter 0.98

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

@github-actions
Copy link

Choose a reason for hiding this comment

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

Benchmark (linux/gcc)

Benchmark suite Current: 5afe305 Previous: 9210087 Ratio
JSONSchema_Compiler_Draft6_AdaptiveCard 6133449696.999947 ns/iter 6182452634.000014 ns/iter 0.99
JSONSchema_Validate_Draft4_Meta_1_No_Callback 1061.350272787481 ns/iter 1072.7780535593524 ns/iter 0.99
JSONSchema_Validate_Draft4_Required_Properties 2302.384788030269 ns/iter 2274.21576511468 ns/iter 1.01
JSONSchema_Validate_Draft4_Many_Optional_Properties_Minimal_Match 188.9912998589589 ns/iter 191.5920024196918 ns/iter 0.99
JSONSchema_Validate_Draft4_Few_Optional_Properties_Minimal_Match 136.550905008004 ns/iter 142.3003870163265 ns/iter 0.96
JSONSchema_Validate_Draft4_Items_Schema 3110.2444607019606 ns/iter 3184.1800264780345 ns/iter 0.98
JSONSchema_Validate_Draft4_Nested_Object 22.672885739523092 ns/iter 23.00818381565316 ns/iter 0.99
JSONSchema_Validate_Draft4_Properties_Triad_Optional 1712.9029918251654 ns/iter 1707.6239410021626 ns/iter 1.00
JSONSchema_Validate_Draft4_Properties_Triad_Closed 1400.5705146252053 ns/iter 1411.3567622529715 ns/iter 0.99
JSONSchema_Validate_Draft4_Properties_Triad_Required 1785.4966321776935 ns/iter 1779.6024326985464 ns/iter 1.00
JSONSchema_Validate_Draft4_Non_Recursive_Ref 465.7115997616824 ns/iter 456.6032951108093 ns/iter 1.02
JSONSchema_Validate_Draft4_Pattern_Properties_True 2319.700609901236 ns/iter 2307.4010096987186 ns/iter 1.01
JSONSchema_Validate_Draft4_Ref_To_Single_Property 143.05750977530425 ns/iter 148.8215983299956 ns/iter 0.96
JSONSchema_Validate_Draft4_Additional_Properties_Type 1093.6232676666727 ns/iter 1078.2262682226394 ns/iter 1.01
JSONSchema_Validate_Draft4_Nested_Oneof 434.7193886349784 ns/iter 440.8486613495904 ns/iter 0.99
JSONSchema_Validate_Draft6_Property_Names 1610.822442725884 ns/iter 1655.3328984673162 ns/iter 0.97
JSONSchema_Validate_Draft7_If_Then_Else 197.23142185694314 ns/iter 204.01306288113955 ns/iter 0.97
JSON_Array_Of_Objects_Unique 3192.962197669479 ns/iter 3180.6082496259733 ns/iter 1.00

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

@github-actions
Copy link

Choose a reason for hiding this comment

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

Benchmark (macos/llvm)

Benchmark suite Current: 5afe305 Previous: 9210087 Ratio
JSON_Array_Of_Objects_Unique 3819.280295139514 ns/iter 3551.688752013014 ns/iter 1.08
JSONSchema_Validate_Draft4_Meta_1_No_Callback 792.3342550669632 ns/iter 744.0397844911156 ns/iter 1.06
JSONSchema_Validate_Draft4_Required_Properties 1006.3276302216291 ns/iter 937.3785880619843 ns/iter 1.07
JSONSchema_Validate_Draft4_Many_Optional_Properties_Minimal_Match 161.78395300516235 ns/iter 150.5257586176018 ns/iter 1.07
JSONSchema_Validate_Draft4_Few_Optional_Properties_Minimal_Match 110.47324714017441 ns/iter 103.17953288754978 ns/iter 1.07
JSONSchema_Validate_Draft4_Items_Schema 2820.1261330169136 ns/iter 2621.7340463275395 ns/iter 1.08
JSONSchema_Validate_Draft4_Nested_Object 25.089252041275895 ns/iter 22.88607193912936 ns/iter 1.10
JSONSchema_Validate_Draft4_Properties_Triad_Optional 1350.7888111138736 ns/iter 1346.6142793359759 ns/iter 1.00
JSONSchema_Validate_Draft4_Properties_Triad_Closed 1029.7599667436 ns/iter 1044.5586643214917 ns/iter 0.99
JSONSchema_Validate_Draft4_Properties_Triad_Required 1390.4813124738794 ns/iter 1325.172184592178 ns/iter 1.05
JSONSchema_Validate_Draft4_Non_Recursive_Ref 229.01282622257312 ns/iter 212.35822183661762 ns/iter 1.08
JSONSchema_Validate_Draft4_Pattern_Properties_True 1438.1051548213377 ns/iter 1356.5620734564156 ns/iter 1.06
JSONSchema_Validate_Draft4_Ref_To_Single_Property 112.59953004806201 ns/iter 105.39928281431875 ns/iter 1.07
JSONSchema_Validate_Draft4_Additional_Properties_Type 437.081666830102 ns/iter 404.6109611596966 ns/iter 1.08
JSONSchema_Validate_Draft4_Nested_Oneof 394.00429231369844 ns/iter 365.12705530099447 ns/iter 1.08
JSONSchema_Validate_Draft6_Property_Names 838.4526499069484 ns/iter 775.7710895558438 ns/iter 1.08
JSONSchema_Validate_Draft7_If_Then_Else 182.64173518954925 ns/iter 168.23663315801025 ns/iter 1.09
JSONSchema_Compiler_Draft6_AdaptiveCard 3294354875.000181 ns/iter 2889689000.0000896 ns/iter 1.14

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

@github-actions
Copy link

Choose a reason for hiding this comment

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

Benchmark (linux/llvm)

Benchmark suite Current: 5afe305 Previous: 9210087 Ratio
JSON_Array_Of_Objects_Unique 2115.6801718407282 ns/iter 2105.1106745487705 ns/iter 1.01
JSONSchema_Validate_Draft4_Meta_1_No_Callback 1059.8590764582987 ns/iter 1018.5094102704204 ns/iter 1.04
JSONSchema_Validate_Draft4_Required_Properties 1650.2428700370192 ns/iter 1659.8907280490973 ns/iter 0.99
JSONSchema_Validate_Draft4_Many_Optional_Properties_Minimal_Match 183.58493238381504 ns/iter 183.3500397405002 ns/iter 1.00
JSONSchema_Validate_Draft4_Few_Optional_Properties_Minimal_Match 131.46954203655602 ns/iter 131.63353163428425 ns/iter 1.00
JSONSchema_Validate_Draft4_Items_Schema 3859.936498811383 ns/iter 3793.4469468819834 ns/iter 1.02
JSONSchema_Validate_Draft4_Nested_Object 33.10249722541583 ns/iter 32.52067729852961 ns/iter 1.02
JSONSchema_Validate_Draft4_Properties_Triad_Optional 1877.994573930771 ns/iter 1804.0293375379326 ns/iter 1.04
JSONSchema_Validate_Draft4_Properties_Triad_Closed 1569.1585099020665 ns/iter 1507.6647223422817 ns/iter 1.04
JSONSchema_Validate_Draft4_Properties_Triad_Required 1956.5711425030001 ns/iter 1887.468363516614 ns/iter 1.04
JSONSchema_Validate_Draft4_Non_Recursive_Ref 478.9805044644016 ns/iter 481.93936483761297 ns/iter 0.99
JSONSchema_Validate_Draft4_Pattern_Properties_True 2572.9070645210763 ns/iter 2470.271941343755 ns/iter 1.04
JSONSchema_Validate_Draft4_Ref_To_Single_Property 134.71649811565348 ns/iter 137.68855208236334 ns/iter 0.98
JSONSchema_Validate_Draft4_Additional_Properties_Type 599.5577557530147 ns/iter 605.2190895614962 ns/iter 0.99
JSONSchema_Validate_Draft4_Nested_Oneof 526.6842172253178 ns/iter 518.2994117881791 ns/iter 1.02
JSONSchema_Validate_Draft6_Property_Names 1308.1940894795428 ns/iter 1285.8222314491036 ns/iter 1.02
JSONSchema_Validate_Draft7_If_Then_Else 225.3230051342133 ns/iter 223.12060945227495 ns/iter 1.01
JSONSchema_Compiler_Draft6_AdaptiveCard 5513867582.999978 ns/iter 5621398539.999973 ns/iter 0.98

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

@github-actions
Copy link

Choose a reason for hiding this comment

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

Benchmark (linux/gcc)

Benchmark suite Current: 5afe305 Previous: 9210087 Ratio
JSONSchema_Compiler_Draft6_AdaptiveCard 6197623475 ns/iter 6182452634.000014 ns/iter 1.00
JSONSchema_Validate_Draft4_Meta_1_No_Callback 1070.9494032571602 ns/iter 1072.7780535593524 ns/iter 1.00
JSONSchema_Validate_Draft4_Required_Properties 2305.5910038272823 ns/iter 2274.21576511468 ns/iter 1.01
JSONSchema_Validate_Draft4_Many_Optional_Properties_Minimal_Match 188.7461408086542 ns/iter 191.5920024196918 ns/iter 0.99
JSONSchema_Validate_Draft4_Few_Optional_Properties_Minimal_Match 135.58295655961163 ns/iter 142.3003870163265 ns/iter 0.95
JSONSchema_Validate_Draft4_Items_Schema 3025.147910605529 ns/iter 3184.1800264780345 ns/iter 0.95
JSONSchema_Validate_Draft4_Nested_Object 23.92191539403958 ns/iter 23.00818381565316 ns/iter 1.04
JSONSchema_Validate_Draft4_Properties_Triad_Optional 1717.3814378666689 ns/iter 1707.6239410021626 ns/iter 1.01
JSONSchema_Validate_Draft4_Properties_Triad_Closed 1418.324623377865 ns/iter 1411.3567622529715 ns/iter 1.00
JSONSchema_Validate_Draft4_Properties_Triad_Required 1785.9956143957647 ns/iter 1779.6024326985464 ns/iter 1.00
JSONSchema_Validate_Draft4_Non_Recursive_Ref 456.58316362009305 ns/iter 456.6032951108093 ns/iter 1.00
JSONSchema_Validate_Draft4_Pattern_Properties_True 2266.4883700583096 ns/iter 2307.4010096987186 ns/iter 0.98
JSONSchema_Validate_Draft4_Ref_To_Single_Property 143.7418833254684 ns/iter 148.8215983299956 ns/iter 0.97
JSONSchema_Validate_Draft4_Additional_Properties_Type 1095.9890900184473 ns/iter 1078.2262682226394 ns/iter 1.02
JSONSchema_Validate_Draft4_Nested_Oneof 432.2722613788277 ns/iter 440.8486613495904 ns/iter 0.98
JSONSchema_Validate_Draft6_Property_Names 1593.7677284140411 ns/iter 1655.3328984673162 ns/iter 0.96
JSONSchema_Validate_Draft7_If_Then_Else 195.85779931487582 ns/iter 204.01306288113955 ns/iter 0.96
JSON_Array_Of_Objects_Unique 3180.856173443663 ns/iter 3180.6082496259733 ns/iter 1.00

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

@github-actions
Copy link

Choose a reason for hiding this comment

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

Benchmark (windows/msvc)

Benchmark suite Current: 5afe305 Previous: 9210087 Ratio
JSON_Array_Of_Objects_Unique 5196.625999999469 ns/iter 5036.791999998513 ns/iter 1.03
JSONSchema_Validate_Draft4_Meta_1_No_Callback 2277.586743764502 ns/iter 2253.7113239828936 ns/iter 1.01
JSONSchema_Validate_Draft4_Required_Properties 2010.314699012218 ns/iter 1971.9620285375267 ns/iter 1.02
JSONSchema_Validate_Draft4_Many_Optional_Properties_Minimal_Match 554.9984000001587 ns/iter 550.6456249999507 ns/iter 1.01
JSONSchema_Validate_Draft4_Few_Optional_Properties_Minimal_Match 408.8273741471818 ns/iter 412.3636958765714 ns/iter 0.99
JSONSchema_Validate_Draft4_Items_Schema 6335.566071427934 ns/iter 6249.376785713625 ns/iter 1.01
JSONSchema_Validate_Draft4_Nested_Object 156.20049107139624 ns/iter 158.38044642860285 ns/iter 0.99
JSONSchema_Validate_Draft4_Properties_Triad_Optional 5421.082142857716 ns/iter 5435.3249999995305 ns/iter 1.00
JSONSchema_Validate_Draft4_Properties_Triad_Closed 4447.7674999996 ns/iter 4442.613750380717 ns/iter 1.00
JSONSchema_Validate_Draft4_Properties_Triad_Required 5524.97946428738 ns/iter 5472.563392856956 ns/iter 1.01
JSONSchema_Validate_Draft4_Non_Recursive_Ref 561.104107142845 ns/iter 537.1533 ns/iter 1.04
JSONSchema_Validate_Draft4_Pattern_Properties_True 8079.265625001244 ns/iter 8141.960937498384 ns/iter 0.99
JSONSchema_Validate_Draft4_Ref_To_Single_Property 417.09606517134927 ns/iter 414.8811608072706 ns/iter 1.01
JSONSchema_Validate_Draft4_Additional_Properties_Type 746.3416294642502 ns/iter 735.3123883928297 ns/iter 1.01
JSONSchema_Validate_Draft4_Nested_Oneof 1071.158593749999 ns/iter 1083.7001562499893 ns/iter 0.99
JSONSchema_Validate_Draft6_Property_Names 1930.5906591414544 ns/iter 1873.808743089966 ns/iter 1.03
JSONSchema_Validate_Draft7_If_Then_Else 542.2320000000127 ns/iter 550.1916071427867 ns/iter 0.99
JSONSchema_Compiler_Draft6_AdaptiveCard 10411014199.999954 ns/iter 10186974299.999975 ns/iter 1.02

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

Please sign in to comment.