t2ym / thin-hook

Thin Hook Preprocessor
Other
4 stars 1 forks source link

Performance optimization #70

Open t2ym opened 7 years ago

t2ym commented 7 years ago

Performance optimization

Targets

t2ym commented 7 years ago

Use Map object when it is faster in hook callback in 0.0.162

Benchmarks with hookBenchmark('__hook__acl')

Chrome version hookacl . (op/s) = (op/s) () (op/s) f (op/s)
61.0.3163.100 0.0.159 1,824,817 2,110,595 954,380 5,824,111
63.0.3239.0 0.0.159 642,756 644,870 315,547 11,494,252
61.0.3163.100 0.0.160 2,236,636 2,283,626 1,034,768 6,172,839
63.0.3239.100 0.0.160 2,123,593 2,382,086 1,034,447 10,695,187
62.0.3202.75 0.0.161 2,718,868 2,503,755 1,198,753 11,185,682
64.0.3251.0 0.0.161 2,534,211 2,478,929 1,251,094 10,615,711
62.0.3202.75 0.0.162 3,657,644 3,463,803 1,327,140 11,123,470
64.0.3251.0 0.0.162 3,374,957 3,328,894 1,426,940 11,261,261
62.0.3202.75 0.0.163 3,707,823 3,828,483 1,536,570 11,876,484
64.0.3251.0 0.0.163 3,173,595 3,423,485 1,636,661 11,976,047
62.0.3202.75 0.0.164 3,780,718 3,599,712 1,534,448 11,682,242
64.0.3251.0 0.0.164 3,585,514 3,462,603 1,488,095 11,467,889
62.0.3202.75 0.0.166 3,590,664 3,692,762 2,135,383 11,402,508
64.0.3251.0 0.0.166 3,457,814 3,542,330 2,298,850 11,454,753
62.0.3202.75 0.0.167 3,724,394 3,838,771 2,030,044 12,019,230
62.0.3202.75 0.0.168 3,620,564 3,425,830 1,962,708 11,001,100
62.0.3202.75 0.0.170 3,536,067 3,579,098 1,860,119 10,193,679
64.0.3256.0 0.0.170 3,980,891 3,947,887 2,370,229 10,905,125
64.0.3260.0 0.0.170 3,885,003 3,897,116 2,408,477 12,787,723
64.0.3260.0 0.0.171 4,086,636 3,595,828 2,397,506 12,360,939

Note

t2ym commented 4 years ago

Benchmarks with hookBenchmark()

Chrome version hook . (op/s) = (op/s) () (op/s) f (op/s)
80.0.3987.87 0.4.0-a.8 acl 1,645,278 1,638,269 1,173,020 3,874,467
80.0.3987.87 0.4.0-a.* min 11,782,726 11,113,580 6,385,288 8,086,689
80.0.3987.87 0.4.0-a.* acl 1,173,158 1,198,897 858,737 4,006,410
80.0.3987.87 0.4.0-a.* 633,874 642,797 519,912 2,023,062

Note