Skip to content

Commit

Permalink
Remove unnecessary reference in Evaluator::hash (#323)
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti authored Dec 20, 2024
1 parent cd3ef28 commit 63006c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/evaluator/evaluator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ auto Evaluator::validate(const Template &schema,
const sourcemeta::jsontoolkit::JSON Evaluator::null{nullptr};
const sourcemeta::jsontoolkit::JSON Evaluator::empty_string{""};

auto Evaluator::hash(const std::size_t &resource,
auto Evaluator::hash(const std::size_t resource,
const sourcemeta::jsontoolkit::JSON::String &fragment)
const noexcept -> std::size_t {
return resource + this->hasher_(fragment);
Expand Down
2 changes: 1 addition & 1 deletion src/evaluator/include/sourcemeta/blaze/evaluator.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class SOURCEMETA_BLAZE_EVALUATOR_EXPORT Evaluator {
static const sourcemeta::jsontoolkit::JSON empty_string;

auto
hash(const std::size_t &resource,
hash(const std::size_t resource,
const sourcemeta::jsontoolkit::JSON::String &fragment) const noexcept
-> std::size_t;

Expand Down

5 comments on commit 63006c3

@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: 63006c3 Previous: cd3ef28 Ratio
Compiler_Draft6_AdaptiveCard 34540619458.00004 ns/iter 36092515332.99994 ns/iter 0.96
Compiler_2019_09_OMC_JSON_V2 7976555290.999954 ns/iter 8358749291.99997 ns/iter 0.95
Evaluator_Draft4_Meta_1_No_Callback 166.4822611707944 ns/iter 176.23094361715368 ns/iter 0.94
Evaluator_Draft4_Required_Properties 440.81957319786227 ns/iter 485.39324347106066 ns/iter 0.91
Evaluator_Draft4_Many_Optional_Properties_Minimal_Match 20.065344536152125 ns/iter 21.749519239129548 ns/iter 0.92
Evaluator_Draft4_Few_Optional_Properties_Minimal_Match 9.371339559026275 ns/iter 9.310060856772344 ns/iter 1.01
Evaluator_Draft4_Items_Schema 260.1750208671394 ns/iter 268.517752200985 ns/iter 0.97
Evaluator_Draft4_Nested_Object 3.1435293540982836 ns/iter 3.2609370795481505 ns/iter 0.96
Evaluator_Draft4_Properties_Triad_Optional 764.6255950474385 ns/iter 760.1404111928706 ns/iter 1.01
Evaluator_Draft4_Properties_Triad_Closed 609.8242094396649 ns/iter 622.4686927206508 ns/iter 0.98
Evaluator_Draft4_Properties_Triad_Required 791.8689194093886 ns/iter 857.2127678970736 ns/iter 0.92
Evaluator_Draft4_Properties_Closed 48.316683529527545 ns/iter 52.680229200007034 ns/iter 0.92
Evaluator_Draft4_Non_Recursive_Ref 9.41149002041146 ns/iter 9.713420328570239 ns/iter 0.97
Evaluator_Draft4_Pattern_Properties_True 161.47390568141822 ns/iter 164.07976257527963 ns/iter 0.98
Evaluator_Draft4_Ref_To_Single_Property 9.2511513094525 ns/iter 9.454461933319127 ns/iter 0.98
Evaluator_Draft4_Additional_Properties_Type 15.679059584309954 ns/iter 15.986712317679942 ns/iter 0.98
Evaluator_Draft4_Nested_Oneof 51.86961670000301 ns/iter 52.14647910000849 ns/iter 0.99
Evaluator_Draft4_Long_Enum 26.551267095684832 ns/iter 28.358069308026234 ns/iter 0.94
Evaluator_Draft4_Type_Object 5.3353956151801265 ns/iter 5.537408469856723 ns/iter 0.96
Evaluator_Draft6_Property_Names 85.78503652082162 ns/iter 90.89379259531151 ns/iter 0.94
Evaluator_Draft7_If_Then_Else 24.215380198921892 ns/iter 25.858160721842587 ns/iter 0.94
Evaluator_Draft7_Vercel_1 35089.635553990105 ns/iter 35357.46609994922 ns/iter 0.99
Evaluator_Draft7_Helm_Chart_Lock_1 142.4782825885226 ns/iter 145.13545363327216 ns/iter 0.98
Evaluator_Draft7_Jasmine_1 119.94617817090484 ns/iter 121.61830900350851 ns/iter 0.99
Evaluator_2019_09_Unevaluated_Properties 131.32385040545236 ns/iter 140.40906353325488 ns/iter 0.94
Evaluator_2019_09_OMC_JSON_V2_1 978.3899996516868 ns/iter 1109.3360798288775 ns/iter 0.88
Evaluator_2020_12_Dynamic_Ref 365.3747546170059 ns/iter 451.1035118938791 ns/iter 0.81
Evaluator_2020_12_Dynamic_Ref_Single 5.524492051590991 ns/iter 7.565115812862848 ns/iter 0.73
Evaluator_2020_12_CQL_1 2639.8699399784127 ns/iter 2525.357807343748 ns/iter 1.05
Evaluator_2020_12_OpenAPI 1989795.9971909162 ns/iter 1891887.4730539906 ns/iter 1.05

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: 63006c3 Previous: cd3ef28 Ratio
Compiler_Draft6_AdaptiveCard 51515539083.00002 ns/iter 50182950488.000015 ns/iter 1.03
Compiler_2019_09_OMC_JSON_V2 11041453631.999956 ns/iter 10660328499.000002 ns/iter 1.04
Evaluator_Draft4_Meta_1_No_Callback 243.86217102202335 ns/iter 242.5948734340768 ns/iter 1.01
Evaluator_Draft4_Required_Properties 687.6987000129639 ns/iter 689.7403493805497 ns/iter 1.00
Evaluator_Draft4_Many_Optional_Properties_Minimal_Match 29.495970577475962 ns/iter 29.68078615459467 ns/iter 0.99
Evaluator_Draft4_Few_Optional_Properties_Minimal_Match 17.110371564637823 ns/iter 17.11582846412052 ns/iter 1.00
Evaluator_Draft4_Items_Schema 576.8581593822253 ns/iter 577.271051424377 ns/iter 1.00
Evaluator_Draft4_Nested_Object 5.284655150931357 ns/iter 5.291166395005175 ns/iter 1.00
Evaluator_Draft4_Properties_Triad_Optional 872.7967083485746 ns/iter 863.96238051855 ns/iter 1.01
Evaluator_Draft4_Properties_Triad_Closed 703.5749075618932 ns/iter 700.7838522005934 ns/iter 1.00
Evaluator_Draft4_Properties_Triad_Required 892.3591948792877 ns/iter 887.0346916320582 ns/iter 1.01
Evaluator_Draft4_Properties_Closed 79.55923288868807 ns/iter 79.09229142400655 ns/iter 1.01
Evaluator_Draft4_Non_Recursive_Ref 32.429807896775166 ns/iter 32.353029500465624 ns/iter 1.00
Evaluator_Draft4_Pattern_Properties_True 254.76688779286312 ns/iter 251.1461287618697 ns/iter 1.01
Evaluator_Draft4_Ref_To_Single_Property 17.103224890180403 ns/iter 17.36401550654934 ns/iter 0.98
Evaluator_Draft4_Additional_Properties_Type 61.55166282795508 ns/iter 61.65673433323811 ns/iter 1.00
Evaluator_Draft4_Nested_Oneof 87.0715696690558 ns/iter 87.13892147629642 ns/iter 1.00
Evaluator_Draft4_Long_Enum 19.29403555405912 ns/iter 21.333901540829768 ns/iter 0.90
Evaluator_Draft4_Type_Object 10.576759492248899 ns/iter 10.643478259813287 ns/iter 0.99
Evaluator_Draft6_Property_Names 127.18361624479483 ns/iter 127.19176442683748 ns/iter 1.00
Evaluator_Draft7_If_Then_Else 39.812929850022535 ns/iter 39.85001262808798 ns/iter 1.00
Evaluator_Draft7_Vercel_1 55349.44551358867 ns/iter 54704.38843105175 ns/iter 1.01
Evaluator_Draft7_Helm_Chart_Lock_1 299.00683630222534 ns/iter 299.2790490372134 ns/iter 1.00
Evaluator_Draft7_Jasmine_1 167.6275713312026 ns/iter 167.1900081794299 ns/iter 1.00
Evaluator_2019_09_Unevaluated_Properties 149.6969972822777 ns/iter 149.5845179098509 ns/iter 1.00
Evaluator_2019_09_OMC_JSON_V2_1 1374.883502529243 ns/iter 1361.8194200779374 ns/iter 1.01
Evaluator_2020_12_Dynamic_Ref 576.0448103972243 ns/iter 572.3020968855648 ns/iter 1.01
Evaluator_2020_12_Dynamic_Ref_Single 10.282727685450318 ns/iter 10.26826755960169 ns/iter 1.00
Evaluator_2020_12_CQL_1 3936.0625289516106 ns/iter 4011.0368626630398 ns/iter 0.98
Evaluator_2020_12_OpenAPI 1296998.9460967204 ns/iter 1288840.6641650575 ns/iter 1.01

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: 63006c3 Previous: cd3ef28 Ratio
Compiler_Draft6_AdaptiveCard 43051293849.94507 ns/iter 42342330217.36145 ns/iter 1.02
Compiler_2019_09_OMC_JSON_V2 8141650915.145874 ns/iter 8164309024.810791 ns/iter 1.00
Evaluator_Draft4_Meta_1_No_Callback 159.65536294045668 ns/iter 157.13636085875763 ns/iter 1.02
Evaluator_Draft4_Required_Properties 372.31614764743796 ns/iter 382.33587727088076 ns/iter 0.97
Evaluator_Draft4_Many_Optional_Properties_Minimal_Match 16.958416054140326 ns/iter 17.15993020415049 ns/iter 0.99
Evaluator_Draft4_Few_Optional_Properties_Minimal_Match 9.150312284182366 ns/iter 9.184716869422727 ns/iter 1.00
Evaluator_Draft4_Items_Schema 433.210142105517 ns/iter 433.89976981743104 ns/iter 1.00
Evaluator_Draft4_Nested_Object 2.04693883149998 ns/iter 2.0559750368678107 ns/iter 1.00
Evaluator_Draft4_Properties_Triad_Optional 761.5908683647326 ns/iter 763.6264265833092 ns/iter 1.00
Evaluator_Draft4_Properties_Triad_Closed 620.4448857613228 ns/iter 633.9353903639992 ns/iter 0.98
Evaluator_Draft4_Properties_Triad_Required 763.4843604140007 ns/iter 775.1764722621718 ns/iter 0.98
Evaluator_Draft4_Properties_Closed 63.13874074283619 ns/iter 63.44071886195438 ns/iter 1.00
Evaluator_Draft4_Non_Recursive_Ref 12.610946729703533 ns/iter 12.622069058198402 ns/iter 1.00
Evaluator_Draft4_Pattern_Properties_True 173.49481451341146 ns/iter 172.4170126010728 ns/iter 1.01
Evaluator_Draft4_Ref_To_Single_Property 9.199852265871861 ns/iter 9.19224552892428 ns/iter 1.00
Evaluator_Draft4_Additional_Properties_Type 23.96929970036406 ns/iter 24.22783954282688 ns/iter 0.99
Evaluator_Draft4_Nested_Oneof 53.836149074945624 ns/iter 54.06256686529317 ns/iter 1.00
Evaluator_Draft4_Long_Enum 9.544981901836913 ns/iter 9.466699519985095 ns/iter 1.01
Evaluator_Draft4_Type_Object 4.5298453058115395 ns/iter 4.565352299058661 ns/iter 0.99
Evaluator_Draft6_Property_Names 109.87671703936265 ns/iter 109.89330010072646 ns/iter 1.00
Evaluator_Draft7_If_Then_Else 24.637794908972452 ns/iter 24.78738518474413 ns/iter 0.99
Evaluator_Draft7_Vercel_1 36341.106278725856 ns/iter 37212.34530830414 ns/iter 0.98
Evaluator_Draft7_Helm_Chart_Lock_1 192.36234555095638 ns/iter 192.6002611067783 ns/iter 1.00
Evaluator_Draft7_Jasmine_1 123.9028094303454 ns/iter 122.96526120467992 ns/iter 1.01
Evaluator_2019_09_Unevaluated_Properties 133.07569767088702 ns/iter 132.234721605587 ns/iter 1.01
Evaluator_2019_09_OMC_JSON_V2_1 1021.6911830028347 ns/iter 993.3953764077778 ns/iter 1.03
Evaluator_2020_12_Dynamic_Ref 445.9121077582385 ns/iter 442.25915248168184 ns/iter 1.01
Evaluator_2020_12_Dynamic_Ref_Single 4.575347605940644 ns/iter 4.537426230164029 ns/iter 1.01
Evaluator_2020_12_CQL_1 2652.273203238931 ns/iter 2930.209522826525 ns/iter 0.91
Evaluator_2020_12_OpenAPI 1203049.2579271346 ns/iter 1881669.3345618718 ns/iter 0.64

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: 63006c3 Previous: cd3ef28 Ratio
Evaluator_2020_12_Dynamic_Ref 648.452813721792 ns/iter 616.8744627364928 ns/iter 1.05
Evaluator_2020_12_Dynamic_Ref_Single 9.65164078417267 ns/iter 9.747153867461481 ns/iter 0.99
Evaluator_2020_12_CQL_1 4184.594686932396 ns/iter 4284.100833882438 ns/iter 0.98
Evaluator_2020_12_OpenAPI 1450034.892561858 ns/iter 1459983.560416589 ns/iter 0.99
Evaluator_2019_09_Unevaluated_Properties 175.67934429188077 ns/iter 171.27284388294635 ns/iter 1.03
Evaluator_2019_09_OMC_JSON_V2_1 1376.355612794503 ns/iter 1390.1570579964734 ns/iter 0.99
Evaluator_Draft7_If_Then_Else 43.88662308027374 ns/iter 43.891268671477214 ns/iter 1.00
Evaluator_Draft7_Vercel_1 47265.92047377542 ns/iter 47342.11885606181 ns/iter 1.00
Evaluator_Draft7_Helm_Chart_Lock_1 197.5066684139729 ns/iter 200.38411332491495 ns/iter 0.99
Evaluator_Draft7_Jasmine_1 157.85695788339046 ns/iter 160.95613363754873 ns/iter 0.98
Evaluator_Draft6_Property_Names 149.2277758039866 ns/iter 148.6812780893148 ns/iter 1.00
Evaluator_Draft4_Meta_1_No_Callback 229.22190457988285 ns/iter 232.22166868535396 ns/iter 0.99
Evaluator_Draft4_Required_Properties 455.5915898610141 ns/iter 456.1677876707312 ns/iter 1.00
Evaluator_Draft4_Many_Optional_Properties_Minimal_Match 25.79904589554291 ns/iter 25.96681893342321 ns/iter 0.99
Evaluator_Draft4_Few_Optional_Properties_Minimal_Match 11.825262429262656 ns/iter 11.847732683301858 ns/iter 1.00
Evaluator_Draft4_Items_Schema 501.9405116236825 ns/iter 505.55771424267766 ns/iter 0.99
Evaluator_Draft4_Nested_Object 4.0651175591883355 ns/iter 4.076922467225271 ns/iter 1.00
Evaluator_Draft4_Properties_Triad_Optional 1062.381159873472 ns/iter 1043.7124085251444 ns/iter 1.02
Evaluator_Draft4_Properties_Triad_Closed 837.7705301353071 ns/iter 822.5579607133462 ns/iter 1.02
Evaluator_Draft4_Properties_Triad_Required 1053.6053379584275 ns/iter 1042.943302368234 ns/iter 1.01
Evaluator_Draft4_Properties_Closed 72.65984467029874 ns/iter 72.62772166137417 ns/iter 1.00
Evaluator_Draft4_Non_Recursive_Ref 12.44300269323178 ns/iter 12.514879708890742 ns/iter 0.99
Evaluator_Draft4_Pattern_Properties_True 268.21158192035386 ns/iter 268.6702814786263 ns/iter 1.00
Evaluator_Draft4_Ref_To_Single_Property 11.862907942851079 ns/iter 11.873276290204599 ns/iter 1.00
Evaluator_Draft4_Additional_Properties_Type 15.255853254315165 ns/iter 15.262221347812838 ns/iter 1.00
Evaluator_Draft4_Nested_Oneof 108.80891143204123 ns/iter 108.75876955658632 ns/iter 1.00
Evaluator_Draft4_Long_Enum 18.688770086091964 ns/iter 18.67996026540278 ns/iter 1.00
Evaluator_Draft4_Type_Object 9.645587123474272 ns/iter 9.697384236814338 ns/iter 0.99
Compiler_2019_09_OMC_JSON_V2 10176622897.000015 ns/iter 10269359642.00004 ns/iter 0.99
Compiler_Draft6_AdaptiveCard 51755814902 ns/iter 51848678422.00004 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: 63006c3 Previous: cd3ef28 Ratio
Compiler_Draft6_AdaptiveCard 111797079900.00009 ns/iter 112556430999.99997 ns/iter 0.99
Compiler_2019_09_OMC_JSON_V2 21514613000.000053 ns/iter 21540618300.000004 ns/iter 1.00
Evaluator_Draft4_Meta_1_No_Callback 375.3215401785605 ns/iter 346.96292018517596 ns/iter 1.08
Evaluator_Draft4_Required_Properties 920.0395089286368 ns/iter 905.6728099675186 ns/iter 1.02
Evaluator_Draft4_Many_Optional_Properties_Minimal_Match 43.375256250001826 ns/iter 38.638515624997034 ns/iter 1.12
Evaluator_Draft4_Few_Optional_Properties_Minimal_Match 21.133909375002702 ns/iter 21.422375286906775 ns/iter 0.99
Evaluator_Draft4_Items_Schema 720.1508928570886 ns/iter 697.0116071427819 ns/iter 1.03
Evaluator_Draft4_Nested_Object 5.901592857142646 ns/iter 6.257083928572017 ns/iter 0.94
Evaluator_Draft4_Properties_Triad_Optional 1629.587500000085 ns/iter 1625.2130634734522 ns/iter 1.00
Evaluator_Draft4_Properties_Triad_Closed 1317.2821428572743 ns/iter 1308.7985714284805 ns/iter 1.01
Evaluator_Draft4_Properties_Triad_Required 1671.0167381584688 ns/iter 1667.6049107142076 ns/iter 1.00
Evaluator_Draft4_Properties_Closed 91.35622767857399 ns/iter 93.49546457609695 ns/iter 0.98
Evaluator_Draft4_Non_Recursive_Ref 32.0220535714252 ns/iter 32.48276300754754 ns/iter 0.99
Evaluator_Draft4_Pattern_Properties_True 233.12553571429362 ns/iter 220.00206249977077 ns/iter 1.06
Evaluator_Draft4_Ref_To_Single_Property 20.862182645475713 ns/iter 21.175851176463805 ns/iter 0.99
Evaluator_Draft4_Additional_Properties_Type 57.998955357143295 ns/iter 57.54830357142891 ns/iter 1.01
Evaluator_Draft4_Nested_Oneof 113.48874999999481 ns/iter 109.26743749999801 ns/iter 1.04
Evaluator_Draft4_Long_Enum 23.367083444565345 ns/iter 23.407352417330923 ns/iter 1.00
Evaluator_Draft4_Type_Object 13.403292127663489 ns/iter 13.019966459732029 ns/iter 1.03
Evaluator_Draft6_Property_Names 158.49770089284883 ns/iter 165.95926339288016 ns/iter 0.96
Evaluator_Draft7_If_Then_Else 54.647090000003125 ns/iter 51.94408928570989 ns/iter 1.05
Evaluator_Draft7_Vercel_1 73665.85937499233 ns/iter 73212.1651785711 ns/iter 1.01
Evaluator_Draft7_Helm_Chart_Lock_1 325.57785714283835 ns/iter 329.924387496651 ns/iter 0.99
Evaluator_Draft7_Jasmine_1 241.14037487275132 ns/iter 231.45770854268912 ns/iter 1.04
Evaluator_2019_09_Unevaluated_Properties 285.6559693903524 ns/iter 285.7561345644323 ns/iter 1.00
Evaluator_2019_09_OMC_JSON_V2_1 1942.5767885904138 ns/iter 2018.1022300251864 ns/iter 0.96
Evaluator_2020_12_Dynamic_Ref 873.0366071430597 ns/iter 841.7757812499665 ns/iter 1.04
Evaluator_2020_12_Dynamic_Ref_Single 13.638634090901853 ns/iter 13.30793392857491 ns/iter 1.02
Evaluator_2020_12_CQL_1 4918.051980403828 ns/iter 4934.215999999196 ns/iter 1.00
Evaluator_2020_12_OpenAPI 1791038.260869201 ns/iter 1844399.2628988745 ns/iter 0.97

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

Please sign in to comment.