Skip to content

Commit

Permalink
Re-organize evaluator to allow multiple implementations (#209)
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti authored Nov 21, 2024
1 parent 84062f8 commit 8cd51b3
Show file tree
Hide file tree
Showing 5 changed files with 494 additions and 513 deletions.
3 changes: 2 additions & 1 deletion src/evaluator/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
noa_library(NAMESPACE sourcemeta PROJECT blaze NAME evaluator
FOLDER "Blaze/Evaluator"
PRIVATE_HEADERS error.h value.h instruction.h context.h
SOURCES evaluator.cc context.cc trace.h dispatch.h)
SOURCES evaluator.cc context.cc trace.h dispatch.h
evaluator_complete.h)

if(BLAZE_INSTALL)
noa_library_install(NAMESPACE sourcemeta PROJECT blaze NAME evaluator)
Expand Down
Loading

5 comments on commit 8cd51b3

@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: 8cd51b3 Previous: 84062f8 Ratio
Compiler_Draft6_AdaptiveCard 31985036375.00005 ns/iter 31724189125.000065 ns/iter 1.01
Compiler_2019_09_OMC_JSON_V2 6939618417.00002 ns/iter 6683087041.999897 ns/iter 1.04
Evaluator_Draft4_Meta_1_No_Callback 283.90614692484576 ns/iter 282.0802018102457 ns/iter 1.01
Evaluator_Draft4_Required_Properties 363.22640320933766 ns/iter 345.2223243040953 ns/iter 1.05
Evaluator_Draft4_Many_Optional_Properties_Minimal_Match 22.977605450526195 ns/iter 21.88413674959562 ns/iter 1.05
Evaluator_Draft4_Few_Optional_Properties_Minimal_Match 10.446854864916205 ns/iter 10.166224085475472 ns/iter 1.03
Evaluator_Draft4_Items_Schema 716.5991027429149 ns/iter 672.3888390024788 ns/iter 1.07
Evaluator_Draft4_Nested_Object 1.4235705613453744 ns/iter 1.4213666959454994 ns/iter 1.00
Evaluator_Draft4_Properties_Triad_Optional 1004.1731805203407 ns/iter 1015.966096560229 ns/iter 0.99
Evaluator_Draft4_Properties_Triad_Closed 700.3980663798826 ns/iter 703.3029722657782 ns/iter 1.00
Evaluator_Draft4_Properties_Triad_Required 992.8974247274311 ns/iter 997.5299255851528 ns/iter 1.00
Evaluator_Draft4_Properties_Closed 93.91595056342322 ns/iter 96.82105441338301 ns/iter 0.97
Evaluator_Draft4_Non_Recursive_Ref 12.699434869284145 ns/iter 11.986382440050052 ns/iter 1.06
Evaluator_Draft4_Pattern_Properties_True 1228.9745645586584 ns/iter 1192.0096500932514 ns/iter 1.03
Evaluator_Draft4_Ref_To_Single_Property 11.671088718425464 ns/iter 10.9645164679721 ns/iter 1.06
Evaluator_Draft4_Additional_Properties_Type 27.41645709334877 ns/iter 25.913948738318464 ns/iter 1.06
Evaluator_Draft4_Nested_Oneof 80.79180974985688 ns/iter 82.57809969139895 ns/iter 0.98
Evaluator_Draft4_Long_Enum 20.73878828348369 ns/iter 21.243805041861048 ns/iter 0.98
Evaluator_Draft4_Type_Object 5.635610218193596 ns/iter 6.029374181698149 ns/iter 0.93
Evaluator_Draft6_Property_Names 268.2366942918151 ns/iter 273.7730150153332 ns/iter 0.98
Evaluator_Draft7_If_Then_Else 39.832373352860316 ns/iter 39.9959829924482 ns/iter 1.00
Evaluator_Draft7_Vercel_1 93678.8659463709 ns/iter 95603.13662916388 ns/iter 0.98
Evaluator_2019_09_Unevaluated_Properties 149.3400394753569 ns/iter 157.5984019286551 ns/iter 0.95
Evaluator_2019_09_OMC_JSON_V2_1 6479.332148346135 ns/iter 6891.801522651866 ns/iter 0.94
Evaluator_2020_12_Dynamic_Ref 514.3584212564152 ns/iter 520.4458146301168 ns/iter 0.99

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: 8cd51b3 Previous: 84062f8 Ratio
Compiler_Draft6_AdaptiveCard 57896197591.00003 ns/iter 57960813534.00001 ns/iter 1.00
Compiler_2019_09_OMC_JSON_V2 10999949022.00001 ns/iter 11083911374.000025 ns/iter 0.99
Evaluator_Draft4_Meta_1_No_Callback 396.7389083017803 ns/iter 405.2955227056597 ns/iter 0.98
Evaluator_Draft4_Required_Properties 777.807376143507 ns/iter 811.0710101633262 ns/iter 0.96
Evaluator_Draft4_Many_Optional_Properties_Minimal_Match 41.13074264737018 ns/iter 44.53194864131483 ns/iter 0.92
Evaluator_Draft4_Few_Optional_Properties_Minimal_Match 24.75342909093421 ns/iter 26.354137208532325 ns/iter 0.94
Evaluator_Draft4_Items_Schema 1215.734114040108 ns/iter 1288.9806910176983 ns/iter 0.94
Evaluator_Draft4_Nested_Object 5.426148824746466 ns/iter 4.947629038488917 ns/iter 1.10
Evaluator_Draft4_Properties_Triad_Optional 1253.0585891702312 ns/iter 1270.0774352740173 ns/iter 0.99
Evaluator_Draft4_Properties_Triad_Closed 976.8242625975341 ns/iter 986.576587308874 ns/iter 0.99
Evaluator_Draft4_Properties_Triad_Required 1282.3663855756074 ns/iter 1300.1420870013847 ns/iter 0.99
Evaluator_Draft4_Properties_Closed 139.17564451292478 ns/iter 147.49593976103404 ns/iter 0.94
Evaluator_Draft4_Non_Recursive_Ref 32.16095038336653 ns/iter 36.568896956210246 ns/iter 0.88
Evaluator_Draft4_Pattern_Properties_True 2015.6169166703573 ns/iter 1993.7749663051693 ns/iter 1.01
Evaluator_Draft4_Ref_To_Single_Property 24.450513522929246 ns/iter 26.070310817928828 ns/iter 0.94
Evaluator_Draft4_Additional_Properties_Type 56.2657165664816 ns/iter 65.23172240805059 ns/iter 0.86
Evaluator_Draft4_Nested_Oneof 149.40144428397585 ns/iter 162.99093933649547 ns/iter 0.92
Evaluator_Draft4_Long_Enum 23.838338808798653 ns/iter 25.06159781768043 ns/iter 0.95
Evaluator_Draft4_Type_Object 13.176965048208716 ns/iter 14.229816291831405 ns/iter 0.93
Evaluator_Draft6_Property_Names 515.8649480223879 ns/iter 534.0288984258825 ns/iter 0.97
Evaluator_Draft7_If_Then_Else 65.30227315126201 ns/iter 78.34543787613471 ns/iter 0.83
Evaluator_Draft7_Vercel_1 128885.54084046706 ns/iter 132106.92452121194 ns/iter 0.98
Evaluator_2019_09_Unevaluated_Properties 197.61786886720498 ns/iter 216.87771828912537 ns/iter 0.91
Evaluator_2019_09_OMC_JSON_V2_1 9453.189124487038 ns/iter 9678.11148611429 ns/iter 0.98
Evaluator_2020_12_Dynamic_Ref 909.0980651474279 ns/iter 888.8731116405095 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 (linux/gcc)

Benchmark suite Current: 8cd51b3 Previous: 84062f8 Ratio
Evaluator_2020_12_Dynamic_Ref 793.1546690474037 ns/iter 823.4239300622858 ns/iter 0.96
Evaluator_2019_09_Unevaluated_Properties 240.54602456636422 ns/iter 259.70387283464254 ns/iter 0.93
Evaluator_2019_09_OMC_JSON_V2_1 12042.297145307644 ns/iter 11750.813326406284 ns/iter 1.02
Evaluator_Draft7_If_Then_Else 56.86327528809758 ns/iter 59.382936612656046 ns/iter 0.96
Evaluator_Draft7_Vercel_1 136113.27555111187 ns/iter 135761.9938148398 ns/iter 1.00
Evaluator_Draft6_Property_Names 1197.1900968538555 ns/iter 1156.8453640396813 ns/iter 1.03
Evaluator_Draft4_Meta_1_No_Callback 482.2509850067865 ns/iter 469.33521748559224 ns/iter 1.03
Evaluator_Draft4_Required_Properties 1730.3690822956842 ns/iter 1686.5246201239663 ns/iter 1.03
Evaluator_Draft4_Many_Optional_Properties_Minimal_Match 42.35395908809266 ns/iter 42.69514671779766 ns/iter 0.99
Evaluator_Draft4_Few_Optional_Properties_Minimal_Match 34.98469375117371 ns/iter 32.72590023663535 ns/iter 1.07
Evaluator_Draft4_Items_Schema 1010.4577290260488 ns/iter 1039.3501260680703 ns/iter 0.97
Evaluator_Draft4_Nested_Object 3.5226100967329517 ns/iter 3.5194475662231146 ns/iter 1.00
Evaluator_Draft4_Properties_Triad_Optional 1382.5628176097462 ns/iter 1308.2476226121526 ns/iter 1.06
Evaluator_Draft4_Properties_Triad_Closed 1098.725811012578 ns/iter 1012.6257360984926 ns/iter 1.09
Evaluator_Draft4_Properties_Triad_Required 1456.2635308510182 ns/iter 1353.9441769537762 ns/iter 1.08
Evaluator_Draft4_Properties_Closed 192.32855140779523 ns/iter 193.02644200289626 ns/iter 1.00
Evaluator_Draft4_Non_Recursive_Ref 55.17073756219704 ns/iter 51.71437035791622 ns/iter 1.07
Evaluator_Draft4_Pattern_Properties_True 2160.320657547888 ns/iter 2077.699672455447 ns/iter 1.04
Evaluator_Draft4_Ref_To_Single_Property 39.191341803969856 ns/iter 37.02587520321882 ns/iter 1.06
Evaluator_Draft4_Additional_Properties_Type 114.43019404563974 ns/iter 106.6153732489056 ns/iter 1.07
Evaluator_Draft4_Nested_Oneof 124.70644540058983 ns/iter 124.48022621856327 ns/iter 1.00
Evaluator_Draft4_Long_Enum 21.122820134032565 ns/iter 20.492743288471033 ns/iter 1.03
Evaluator_Draft4_Type_Object 10.979960175049643 ns/iter 11.520518209398302 ns/iter 0.95
Compiler_2019_09_OMC_JSON_V2 11346374488.000038 ns/iter 11388352207.000025 ns/iter 1.00
Compiler_Draft6_AdaptiveCard 65120359871.00001 ns/iter 64957627198.00007 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/gcc)

Benchmark suite Current: 8cd51b3 Previous: 84062f8 Ratio
Compiler_Draft6_AdaptiveCard 44475838899.61243 ns/iter 43163286209.106445 ns/iter 1.03
Compiler_2019_09_OMC_JSON_V2 8237370967.86499 ns/iter 7939328908.920288 ns/iter 1.04
Evaluator_Draft4_Meta_1_No_Callback 274.58410137645615 ns/iter 261.6121311292643 ns/iter 1.05
Evaluator_Draft4_Required_Properties 456.6259039775919 ns/iter 445.85226142230573 ns/iter 1.02
Evaluator_Draft4_Many_Optional_Properties_Minimal_Match 27.385231470688712 ns/iter 25.983330349862285 ns/iter 1.05
Evaluator_Draft4_Few_Optional_Properties_Minimal_Match 13.78896191782493 ns/iter 13.60188762673659 ns/iter 1.01
Evaluator_Draft4_Items_Schema 754.9633093460683 ns/iter 721.0098345120753 ns/iter 1.05
Evaluator_Draft4_Nested_Object 2.0179182722940516 ns/iter 1.970710735360721 ns/iter 1.02
Evaluator_Draft4_Properties_Triad_Optional 1058.7041862618446 ns/iter 1038.119546295882 ns/iter 1.02
Evaluator_Draft4_Properties_Triad_Closed 857.1285911750468 ns/iter 830.1092206481844 ns/iter 1.03
Evaluator_Draft4_Properties_Triad_Required 1072.990119486047 ns/iter 1026.2537738856097 ns/iter 1.05
Evaluator_Draft4_Properties_Closed 108.91765027138105 ns/iter 105.51387473396117 ns/iter 1.03
Evaluator_Draft4_Non_Recursive_Ref 22.179048565324546 ns/iter 21.705791301893694 ns/iter 1.02
Evaluator_Draft4_Pattern_Properties_True 1630.768312714343 ns/iter 1597.8431191635477 ns/iter 1.02
Evaluator_Draft4_Ref_To_Single_Property 13.096144452254837 ns/iter 13.053783470341177 ns/iter 1.00
Evaluator_Draft4_Additional_Properties_Type 36.5510701559691 ns/iter 35.56972489472655 ns/iter 1.03
Evaluator_Draft4_Nested_Oneof 89.26536200747948 ns/iter 88.1469560044287 ns/iter 1.01
Evaluator_Draft4_Long_Enum 11.72927679980761 ns/iter 11.35688983928892 ns/iter 1.03
Evaluator_Draft4_Type_Object 7.204088067976533 ns/iter 6.984113114960489 ns/iter 1.03
Evaluator_Draft6_Property_Names 407.96188859192415 ns/iter 366.7425103463669 ns/iter 1.11
Evaluator_Draft7_If_Then_Else 36.91676247243378 ns/iter 35.39113640631032 ns/iter 1.04
Evaluator_Draft7_Vercel_1 96304.3884700335 ns/iter 98709.13876021472 ns/iter 0.98
Evaluator_2019_09_Unevaluated_Properties 157.53627385038195 ns/iter 156.26817154477348 ns/iter 1.01
Evaluator_2019_09_OMC_JSON_V2_1 6181.899375072626 ns/iter 5918.0042564312225 ns/iter 1.04
Evaluator_2020_12_Dynamic_Ref 588.5644996233286 ns/iter 542.5725579877555 ns/iter 1.08

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: 8cd51b3 Previous: 84062f8 Ratio
Compiler_Draft6_AdaptiveCard 118045273000.00006 ns/iter 119451326300.00012 ns/iter 0.99
Compiler_2019_09_OMC_JSON_V2 25330988899.999966 ns/iter 25521693599.999935 ns/iter 0.99
Evaluator_Draft4_Meta_1_No_Callback 725.6973214284963 ns/iter 716.0393973213124 ns/iter 1.01
Evaluator_Draft4_Required_Properties 1040.9545312500156 ns/iter 1047.0201575803069 ns/iter 0.99
Evaluator_Draft4_Many_Optional_Properties_Minimal_Match 71.53971428570978 ns/iter 71.03120535713207 ns/iter 1.01
Evaluator_Draft4_Few_Optional_Properties_Minimal_Match 32.0193258928571 ns/iter 31.926037998844237 ns/iter 1.00
Evaluator_Draft4_Items_Schema 2276.039535670082 ns/iter 2267.566875000426 ns/iter 1.00
Evaluator_Draft4_Nested_Object 3.1033397321427816 ns/iter 2.9633794642854077 ns/iter 1.05
Evaluator_Draft4_Properties_Triad_Optional 4654.253866121249 ns/iter 6153.902678570537 ns/iter 0.76
Evaluator_Draft4_Properties_Triad_Closed 3724.883348422649 ns/iter 5202.203000001191 ns/iter 0.72
Evaluator_Draft4_Properties_Triad_Required 4590.758238299767 ns/iter 6099.518750001413 ns/iter 0.75
Evaluator_Draft4_Properties_Closed 253.87389285713525 ns/iter 253.79239285712174 ns/iter 1.00
Evaluator_Draft4_Non_Recursive_Ref 87.62272321428202 ns/iter 88.00297374989266 ns/iter 1.00
Evaluator_Draft4_Pattern_Properties_True 9526.943629715142 ns/iter 15786.513392857922 ns/iter 0.60
Evaluator_Draft4_Ref_To_Single_Property 32.2638839285716 ns/iter 32.271966129253144 ns/iter 1.00
Evaluator_Draft4_Additional_Properties_Type 173.60660314329604 ns/iter 177.97497843585725 ns/iter 0.98
Evaluator_Draft4_Nested_Oneof 264.1580408106248 ns/iter 253.22946428567712 ns/iter 1.04
Evaluator_Draft4_Long_Enum 50.79079999999294 ns/iter 50.111020000008466 ns/iter 1.01
Evaluator_Draft4_Type_Object 17.049990064397313 ns/iter 17.04042153767778 ns/iter 1.00
Evaluator_Draft6_Property_Names 942.8288648086079 ns/iter 927.8456125689811 ns/iter 1.02
Evaluator_Draft7_If_Then_Else 93.09349137975425 ns/iter 92.82795121302408 ns/iter 1.00
Evaluator_Draft7_Vercel_1 214371.21874999575 ns/iter 217149.93750002523 ns/iter 0.99
Evaluator_2019_09_Unevaluated_Properties 457.88010056784935 ns/iter 784.7859374999291 ns/iter 0.58
Evaluator_2019_09_OMC_JSON_V2_1 13990.899594199342 ns/iter 13967.405279440614 ns/iter 1.00
Evaluator_2020_12_Dynamic_Ref 1393.1989762507465 ns/iter 1374.776305903463 ns/iter 1.01

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

Please sign in to comment.