Bug 153583 - LowerToAir::preferRightForResult() should resolve use count ties by selecting the child that is closest in an idom walk
Summary: LowerToAir::preferRightForResult() should resolve use count ties by selecting...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords:
Depends on: 153477
Blocks: 150279
  Show dependency treegraph
 
Reported: 2016-01-27 21:46 PST by Filip Pizlo
Modified: 2016-01-28 09:30 PST (History)
12 users (show)

See Also:


Attachments
the patch (3.26 KB, patch)
2016-01-27 21:48 PST, Filip Pizlo
benjamin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2016-01-27 21:46:49 PST
Patch forthcoming.
Comment 1 Filip Pizlo 2016-01-27 21:48:26 PST
Created attachment 270092 [details]
the patch
Comment 2 Filip Pizlo 2016-01-27 22:20:27 PST
Performance is great.


Benchmark report for SunSpider, V8Spider, Octane, Kraken, and AsmBench on shakezilla (MacBookPro11,3).

VMs tested:
"LLVMToT" at /Volumes/Data/secondary/OpenSource/WebKitBuild/Release/jsc (r195683)
"B3ToT" at /Volumes/Data/quartary/OpenSource/WebKitBuild/Release/jsc (r195683)
"IntRangeResultTie" at /Volumes/Data/tertiary/OpenSource/WebKitBuild/Release/jsc (r195727)

Collected 6 samples per benchmark/VM, with 6 VM invocations per benchmark. Emitted a call to gc() between sample measurements. Used 1 benchmark
iteration per VM invocation for warm-up. Used the jsc-specific preciseTime() function to get microsecond-level timing. Reporting benchmark execution
times with 95% confidence intervals in milliseconds.

                                                 LLVMToT                    B3ToT               IntRangeResultTie       IntRangeResultTie v. LLVMToT
SunSpider:
   3d-cube                                    4.7868+-0.2815     ?      4.8253+-0.2163            4.7780+-0.1649        
   3d-morph                                   5.6364+-0.2738            5.4150+-0.0928            5.4127+-0.0806          might be 1.0413x faster
   3d-raytrace                                5.5544+-0.2719            5.5263+-0.1225     ?      5.5907+-0.3660        ?
   access-binary-trees                        2.1321+-0.0821     ?      2.3525+-0.3584            2.1240+-0.1099        
   access-fannkuch                            5.7092+-0.1440            5.6554+-0.0604     ?      5.7390+-0.1997        ?
   access-nbody                               2.7085+-0.1070     ?      2.7121+-0.0783     ?      2.8502+-0.3419        ? might be 1.0523x slower
   access-nsieve                              3.5424+-0.2419            3.2070+-0.1591            3.1936+-0.1696          might be 1.1092x faster
   bitops-3bit-bits-in-byte                   1.1918+-0.0365     ?      1.2418+-0.0750            1.1825+-0.0229        
   bitops-bits-in-byte                        3.1667+-0.0612     ?      3.1761+-0.0907            3.1346+-0.0460          might be 1.0102x faster
   bitops-bitwise-and                         1.9809+-0.0357            1.9589+-0.0194     ?      2.0785+-0.2312        ? might be 1.0493x slower
   bitops-nsieve-bits                         3.0190+-0.0810            2.9652+-0.0485     ?      2.9932+-0.0770        
   controlflow-recursive                      2.3630+-0.0406            2.3073+-0.0352     ?      2.4025+-0.1975        ? might be 1.0167x slower
   crypto-aes                                 4.0763+-0.1320            3.9845+-0.0495     ?      4.0228+-0.0513          might be 1.0133x faster
   crypto-md5                                 2.5489+-0.1657            2.4900+-0.0233            2.4760+-0.0468          might be 1.0294x faster
   crypto-sha1                                2.5167+-0.1554     ?      2.6619+-0.0732     ^      2.4764+-0.1106          might be 1.0163x faster
   date-format-tofte                          7.4203+-0.1415     ^      6.8451+-0.1873     ?      6.9632+-0.1901        ^ definitely 1.0656x faster
   date-format-xparb                          4.6837+-0.0694     ?      4.8920+-0.4579     ?      4.9088+-0.5330        ? might be 1.0481x slower
   math-cordic                                2.9353+-0.0171     ?      2.9582+-0.0705            2.9404+-0.0834        ?
   math-partial-sums                          5.0071+-0.2618            4.8955+-0.0623            4.8215+-0.0394          might be 1.0385x faster
   math-spectral-norm                         2.0692+-0.0338     ?      2.1110+-0.1384            2.0952+-0.0570        ? might be 1.0126x slower
   regexp-dna                                 6.4076+-0.2203            6.3205+-0.2380            6.1802+-0.1799          might be 1.0368x faster
   string-base64                              4.6141+-0.1047     ?      4.6174+-0.0840            4.6077+-0.1342        
   string-fasta                               5.8393+-0.1244            5.7441+-0.0525     ?      5.7911+-0.1190        
   string-tagcloud                            8.0772+-0.5305     ?      8.2496+-0.5266            7.8110+-0.0823          might be 1.0341x faster
   string-unpack-code                        19.2227+-1.3339     ?     19.5211+-0.9737           18.6553+-0.6031          might be 1.0304x faster
   string-validate-input                      4.3283+-0.0854            4.2504+-0.0842            4.2223+-0.0712          might be 1.0251x faster

   <arithmetic>                               4.6745+-0.0637            4.6494+-0.0270            4.5943+-0.0352          might be 1.0175x faster

                                                 LLVMToT                    B3ToT               IntRangeResultTie       IntRangeResultTie v. LLVMToT
V8Spider:
   crypto                                    50.6172+-0.8063     ^     38.0944+-0.4680           37.8385+-1.0320        ^ definitely 1.3377x faster
   deltablue                                 78.7497+-2.2153     ^     52.9686+-1.9318     ?     54.0748+-1.7604        ^ definitely 1.4563x faster
   earley-boyer                              43.8992+-2.1352           42.1202+-0.7371           41.8734+-0.8442          might be 1.0484x faster
   raytrace                                  30.4988+-1.3855     ^     20.8573+-0.8064           20.4883+-0.7649        ^ definitely 1.4886x faster
   regexp                                    63.5347+-1.5673           62.5897+-1.1853     ?     62.6914+-1.8203          might be 1.0135x faster
   richards                                  52.7556+-1.1944     ^     40.2718+-0.7943     ?     40.4253+-1.4797        ^ definitely 1.3050x faster
   splay                                     38.2197+-0.7033           36.8014+-1.3184     ?     36.8274+-1.8142          might be 1.0378x faster

   <geometric>                               49.0414+-0.6832     ^     40.0124+-0.5709           39.9853+-0.5778        ^ definitely 1.2265x faster

                                                 LLVMToT                    B3ToT               IntRangeResultTie       IntRangeResultTie v. LLVMToT
Octane:
   encrypt                                   0.15205+-0.00039    !     0.16076+-0.00385          0.15910+-0.00345       ! definitely 1.0464x slower
   decrypt                                   2.90081+-0.00599    ^     2.81434+-0.00715    ^     2.76677+-0.00440       ^ definitely 1.0484x faster
   deltablue                        x2       0.13712+-0.00197          0.13482+-0.00331          0.13391+-0.00188         might be 1.0240x faster
   earley                                    0.28233+-0.00328          0.27799+-0.00359          0.27796+-0.00302         might be 1.0157x faster
   boyer                                     4.23605+-0.01324    !     4.29561+-0.02226    ?     4.30663+-0.00993       ! definitely 1.0167x slower
   navier-stokes                    x2       4.80442+-0.01421    ?     4.80731+-0.02071          4.78451+-0.00512       ^ definitely 1.0042x faster
   raytrace                         x2       0.85049+-0.00423    !     0.87279+-0.00517          0.87060+-0.00305       ! definitely 1.0236x slower
   richards                         x2       0.08571+-0.00104    ^     0.07783+-0.00105    ?     0.07875+-0.00115       ^ definitely 1.0884x faster
   splay                            x2       0.35215+-0.00335    ?     0.35240+-0.00397    ?     0.35381+-0.00423       ?
   regexp                           x2      24.44420+-0.38045         24.07823+-0.45033    ?    24.26558+-0.29596       
   pdfjs                            x2      37.74735+-0.33441    ?    37.80085+-0.59317         37.58011+-0.33760       
   mandreel                         x2      42.59685+-0.27649    ?    43.08369+-0.41976         43.03390+-0.49042       ? might be 1.0103x slower
   gbemu                            x2      30.07276+-1.97624    ?    32.31426+-2.45155         31.58574+-0.16929       ? might be 1.0503x slower
   closure                                   0.56629+-0.00258          0.55992+-0.00424    ?     0.56022+-0.00195       ^ definitely 1.0108x faster
   jquery                                    7.36849+-0.05980    ^     7.25221+-0.02702    ?     7.31534+-0.06379       
   box2d                            x2       9.14968+-0.04354          9.04354+-0.07781    ?     9.13952+-0.03874       
   zlib                             x2     390.75338+-6.96674        383.96236+-15.33596   ?   389.82506+-9.95550       
   typescript                       x2     666.12174+-8.54683    ?   674.75081+-27.22033       666.94397+-14.59913      ?

   <geometric>                               5.28699+-0.02790          5.27420+-0.04054          5.27020+-0.01419         might be 1.0032x faster

                                                 LLVMToT                    B3ToT               IntRangeResultTie       IntRangeResultTie v. LLVMToT
Kraken:
   ai-astar                                  128.430+-1.538      ^      93.769+-2.474             93.432+-0.897         ^ definitely 1.3746x faster
   audio-beat-detection                       49.458+-0.166      !      59.269+-0.802      ^      54.922+-0.286         ! definitely 1.1105x slower
   audio-dft                                  95.576+-1.890      ?      96.949+-3.010             96.005+-2.287         ?
   audio-fft                                  36.022+-1.572      !      47.503+-0.813      ^      43.272+-0.212         ! definitely 1.2013x slower
   audio-oscillator                           57.931+-1.198      ^      51.428+-1.854             51.017+-1.087         ^ definitely 1.1355x faster
   imaging-darkroom                           59.509+-0.100      !      60.686+-0.057      ?      61.000+-1.960         ? might be 1.0251x slower
   imaging-desaturate                         48.273+-0.264      ^      43.311+-0.391      ?      43.741+-0.679         ^ definitely 1.1036x faster
   imaging-gaussian-blur                      86.639+-0.920      ^      67.517+-0.479      ?      68.136+-0.345         ^ definitely 1.2716x faster
   json-parse-financial                       37.665+-1.001      ?      37.739+-1.344             37.515+-0.910         
   json-stringify-tinderbox                   22.157+-0.605      ?      22.726+-0.644      ?      23.162+-0.353         ! definitely 1.0454x slower
   stanford-crypto-aes                        42.631+-1.200             41.913+-1.579      ?      42.838+-2.336         ?
   stanford-crypto-ccm                        38.123+-1.328      ?      39.390+-2.078             37.795+-2.042         
   stanford-crypto-pbkdf2                     97.494+-0.674      !      98.928+-0.514      ?      99.142+-0.348         ! definitely 1.0169x slower
   stanford-crypto-sha256-iterative           37.540+-1.184      ?      38.207+-1.662      ?      38.643+-0.824         ? might be 1.0294x slower

   <arithmetic>                               59.818+-0.107      ^      57.095+-0.388             56.473+-0.437         ^ definitely 1.0592x faster

                                                 LLVMToT                    B3ToT               IntRangeResultTie       IntRangeResultTie v. LLVMToT
AsmBench:
   bigfib.cpp                               449.6363+-8.0252     ?    459.7618+-14.9895         454.5553+-8.9742        ? might be 1.0109x slower
   cray.c                                   390.4478+-2.1556          387.2905+-2.9131     ^    374.8730+-1.8157        ^ definitely 1.0415x faster
   dry.c                                    413.2968+-8.9830     ?    414.1680+-12.4379         409.9243+-4.1435        
   FloatMM.c                                680.6209+-0.6985     !    735.0622+-3.6272          734.9834+-2.9606        ! definitely 1.0799x slower
   gcc-loops.cpp                           3446.3645+-51.2775    ?   3495.3138+-5.9967     ?   3500.0423+-10.3657       ? might be 1.0156x slower
   n-body.c                                 847.5238+-65.3937    !   1170.9742+-2.6420     ^    851.1848+-1.5462        ?
   Quicksort.c                              404.0680+-4.0243          397.1890+-3.5025          395.3180+-4.7062        ^ definitely 1.0221x faster
   stepanov_container.cpp                  3486.7481+-19.2881    ^   3211.4794+-19.9022    ?   3224.5616+-18.1876       ^ definitely 1.0813x faster
   Towers.c                                 233.1697+-3.0000     !    249.3888+-0.8874          249.2753+-0.4977        ! definitely 1.0691x slower

   <geometric>                              712.4230+-6.3717     !    744.8021+-3.6816     ^    714.5944+-1.6391        ? might be 1.0030x slower

                                                 LLVMToT                    B3ToT               IntRangeResultTie       IntRangeResultTie v. LLVMToT
Geomean of preferred means:
   <scaled-result>                           34.8819+-0.0873     ^     33.4249+-0.1811     ^     32.9885+-0.1670        ^ definitely 1.0574x faster
Comment 3 Benjamin Poulain 2016-01-28 00:07:59 PST
Comment on attachment 270092 [details]
the patch

View in context: https://bugs.webkit.org/attachment.cgi?id=270092&action=review

> Source/JavaScriptCore/ChangeLog:3
> +        LowerToAir::preferRightForResult() should resolve use count ties by selecting the child that is closest in an idom walk

I thought about picking the closest but that seemed overkill at the time.

I guess it is not that crazy :)
Comment 4 Filip Pizlo 2016-01-28 09:30:29 PST
Landed in http://trac.webkit.org/changeset/195744