Bug 69906 - ValueProfile::computeUpdatedPrediction doesn't merge statistics correctly
Summary: ValueProfile::computeUpdatedPrediction doesn't merge statistics correctly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-11 23:14 PDT by Filip Pizlo
Modified: 2011-10-12 13:28 PDT (History)
0 users

See Also:


Attachments
the patch (11.76 KB, patch)
2011-10-12 12:46 PDT, Filip Pizlo
barraclough: 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 2011-10-11 23:14:23 PDT
computeUpdatedPrediction() will return PredictOther when a value profile has a mix of types.  PredictOther means Undefined or Null, so that's clearly wrong.

Currently this should be benign, in the sense that it should just cause speculation failures.  But that's not so great for performance.
Comment 1 Filip Pizlo 2011-10-12 12:46:49 PDT
Created attachment 110724 [details]
the patch

Benchmark report for SunSpider, V8, and Kraken.

VMs tested:
"TipOfTree" at /Volumes/Data/pizlo/OpenSource/WebKitBuild/Release/jsc
"FixProfile" at /Volumes/Data/pizlo/senary/OpenSource/WebKitBuild/Release/jsc

Collected 12 samples per benchmark/VM, with 4 VM invocations per benchmark. 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.

                                            TipOfTree               FixProfile                                   
SunSpider:
   3d-cube                                7.3870+-0.1434          7.2386+-0.1102         might be 1.0205x faster
   3d-morph                               8.3775+-0.8625          7.7184+-0.1144         might be 1.0854x faster
   3d-raytrace                            7.6431+-0.2087    ?     7.7190+-0.2071       ?
   access-binary-trees                    1.6935+-0.0550          1.6806+-0.0443       
   access-fannkuch                        6.3731+-0.0945          6.3581+-0.0887       
   access-nbody                           3.3125+-0.0656          3.3009+-0.0592       
   access-nsieve                          2.5846+-0.0640    ?     2.6321+-0.0843       ? might be 1.0184x slower
   bitops-3bit-bits-in-byte               1.7253+-0.0274    ?     1.7582+-0.0381       ? might be 1.0191x slower
   bitops-bits-in-byte                    2.8091+-0.0514          2.7252+-0.0738         might be 1.0308x faster
   bitops-bitwise-and                     3.3941+-0.0747          3.3556+-0.1009         might be 1.0115x faster
   bitops-nsieve-bits                     5.5153+-0.0988          5.5105+-0.1199       
   controlflow-recursive                  2.1138+-0.0531    ?     2.1456+-0.0747       ? might be 1.0151x slower
   crypto-aes                             6.8299+-0.1630          6.7437+-0.1648         might be 1.0128x faster
   crypto-md5                             2.8610+-0.0692          2.8318+-0.0672         might be 1.0103x faster
   crypto-sha1                            2.5423+-0.0838          2.4897+-0.0638         might be 1.0211x faster
   date-format-tofte                      9.9869+-0.1586    ?    10.1792+-0.1745       ? might be 1.0192x slower
   date-format-xparb                      9.0433+-0.2143    ?     9.2611+-0.2927       ? might be 1.0241x slower
   math-cordic                            6.3837+-0.0624    ?     6.4447+-0.0731       ?
   math-partial-sums                      7.5753+-0.1140    ?     7.6394+-0.1411       ?
   math-spectral-norm                     2.8914+-0.0627          2.8819+-0.0647       
   regexp-dna                            10.7096+-0.1479    ?    10.7654+-0.1319       ?
   string-base64                          5.2383+-0.0718    ?     5.3516+-0.0729       ? might be 1.0216x slower
   string-fasta                           6.5073+-0.1150    ?     6.5156+-0.1362       ?
   string-tagcloud                       11.2380+-0.2166         11.1545+-0.2043       
   string-unpack-code                    20.6586+-0.2970    ?    20.9446+-0.7071       ? might be 1.0138x slower
   string-validate-input                  6.3705+-0.1253    ?     6.3803+-0.1194       ?

   <arithmetic> *                         6.2217+-0.0484          6.2202+-0.0301       
   <geometric>                            5.1214+-0.0359          5.1132+-0.0210       
   <harmonic>                             4.2060+-0.0348          4.1995+-0.0276       

                                            TipOfTree               FixProfile                                   
V8:
   crypto                                72.8527+-0.4478         72.4592+-0.2900       
   deltablue                            225.1709+-2.3335        223.6545+-1.7005       
   earley-boyer                          91.8261+-0.3565    ?    92.0220+-0.4391       ?
   raytrace                              59.7300+-0.7757    ^    57.8942+-0.3434       ^ definitely 1.0317x faster
   regexp                               106.3592+-0.3718        105.3202+-0.9491       
   richards                             186.9082+-6.5842        182.6153+-0.3850         might be 1.0235x faster
   splay                                 95.6470+-0.8616         95.0531+-0.3847       

   <arithmetic>                         119.7849+-0.6726    ^   118.4312+-0.3341       ^ definitely 1.0114x faster
   <geometric> *                        107.9463+-0.4507    ^   106.7343+-0.3124       ^ definitely 1.0114x faster
   <harmonic>                            98.5508+-0.4177    ^    97.3485+-0.3249       ^ definitely 1.0123x faster

                                            TipOfTree               FixProfile                                   
Kraken:
   ai-astar                             501.1981+-3.1509        500.6884+-6.7670       
   audio-beat-detection                 192.4552+-0.6351    ?   192.6383+-0.8518       ?
   audio-dft                            271.7373+-6.4749        268.6449+-1.9443         might be 1.0115x faster
   audio-fft                            125.2747+-0.7431        124.7780+-0.7993       
   audio-oscillator                     252.5998+-2.1763    ?   254.1639+-2.6871       ?
   imaging-darkroom                     420.0759+-1.9578        417.9027+-1.5970       
   imaging-desaturate                   218.0847+-0.4997    !   219.9462+-0.8396       ! definitely 1.0085x slower
   imaging-gaussian-blur                557.8666+-1.8411        556.8822+-2.5415       
   json-parse-financial                  54.7763+-0.2994    ?    55.0612+-0.2650       ?
   json-stringify-tinderbox              68.9615+-1.0041         68.5430+-0.4149       
   stanford-crypto-aes                  130.8375+-1.5580    ?   132.8984+-1.7029       ? might be 1.0158x slower
   stanford-crypto-ccm                  104.6360+-0.6860    ?   104.6884+-1.2097       ?
   stanford-crypto-pbkdf2               194.7741+-0.7511    ^   192.6652+-0.5280       ^ definitely 1.0109x faster
   stanford-crypto-sha256-iterative      71.8618+-1.0272         71.0898+-0.4693         might be 1.0109x faster

   <arithmetic> *                       226.0814+-0.7470        225.7565+-0.7902       
   <geometric>                          177.4289+-0.7113        177.2551+-0.5811       
   <harmonic>                           139.1710+-0.7181        139.0418+-0.5170       

                                            TipOfTree               FixProfile                                   
All benchmarks:
   <arithmetic>                          88.6255+-0.3154         88.3263+-0.2447       
   <geometric>                           23.1825+-0.1145         23.1166+-0.0570       
   <harmonic>                             7.3978+-0.0599          7.3855+-0.0473       

                                            TipOfTree               FixProfile                                   
Geomean of preferred means:
   <scaled-result>                       53.3485+-0.2212         53.1184+-0.1106
Comment 2 Filip Pizlo 2011-10-12 13:28:04 PDT
Landed in r97294.