Bug 77403

Summary: Stop using -fomit-frame-pointer
Product: WebKit Reporter: Geoffrey Garen <ggaren@apple.com>
Component: JavaScriptCoreAssignee: Geoffrey Garen <ggaren@apple.com>
Status: RESOLVED FIXED    
Severity: Normal CC: ap@webkit.org, aroben@webkit.org, barraclough@apple.com, fpizlo@apple.com
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch fpizlo: review+

Description From 2012-01-30 21:35:55 PST
It breaks a lot of debugging and profiling tools.
------- Comment #1 From 2012-01-30 21:37:16 PST -------
Looks like -fomit-frame-pointer is worth 0.8% - 2.1%, depending on how you measure:

Benchmark report for SunSpider, V8, and Kraken on garen (MacPro5,1).

VMs tested:
"BASELINE" at /Volumes/Big/ggaren/baseline-webkit/WebKitBuild/Release/jsc (r104476)
"PATCH" at /Volumes/Big/ggaren/webkit/WebKitBuild/Release/jsc (r106297)

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

                                             BASELINE                 PATCH                                      
SunSpider:
   3d-cube                                6.2832+-0.0705    ?     6.3624+-0.0529       ? might be 1.0126x slower
   3d-morph                              10.3329+-0.0833    !    11.1263+-0.0962       ! definitely 1.0768x slower
   3d-raytrace                            9.0501+-0.1140    ?     9.0610+-0.0583       ?
   access-binary-trees                    1.9275+-0.0565    ?     1.9422+-0.0469       ?
   access-fannkuch                        8.5806+-0.0615    ?     8.6193+-0.0574       ?
   access-nbody                           4.6266+-0.0129    ?     4.6468+-0.0199       ?
   access-nsieve                          4.0076+-0.0359    ?     4.0448+-0.0666       ?
   bitops-3bit-bits-in-byte               1.4710+-0.0128    ?     1.4991+-0.0242       ? might be 1.0191x slower
   bitops-bits-in-byte                    6.0283+-0.0315          6.0206+-0.0241       
   bitops-bitwise-and                     3.7821+-0.0031    ?     3.8177+-0.0489       ?
   bitops-nsieve-bits                     6.5326+-0.0398    ?     6.5447+-0.0434       ?
   controlflow-recursive                  2.6963+-0.0090    ?     2.7020+-0.0099       ?
   crypto-aes                             8.6589+-0.1152    ?     8.7653+-0.1248       ? might be 1.0123x slower
   crypto-md5                             2.9537+-0.0415    ?     2.9915+-0.0300       ? might be 1.0128x slower
   crypto-sha1                            2.6467+-0.0271    ?     2.6827+-0.0248       ? might be 1.0136x slower
   date-format-tofte                     12.3344+-0.2090    ?    12.3843+-0.1693       ?
   date-format-xparb                     11.7982+-0.1534         11.4550+-0.2289         might be 1.0300x faster
   math-cordic                            8.4270+-0.0401    !     8.5359+-0.0531       ! definitely 1.0129x slower
   math-partial-sums                     12.7962+-0.8647         12.1591+-0.0395         might be 1.0524x faster
   math-spectral-norm                     3.0514+-0.0086    ?     3.0685+-0.0093       ?
   regexp-dna                            10.2264+-0.0879         10.1472+-0.0854       
   string-base64                          5.0800+-0.0954    ?     5.1075+-0.0649       ?
   string-fasta                           8.1116+-0.0443    !     8.3843+-0.1035       ! definitely 1.0336x slower
   string-tagcloud                       14.6432+-0.1840    ?    14.9873+-0.1952       ? might be 1.0235x slower
   string-unpack-code                    23.7459+-0.2290    !    24.2807+-0.2670       ! definitely 1.0225x slower
   string-validate-input                  6.4673+-0.0989    ?     6.5887+-0.0723       ? might be 1.0188x slower

   <arithmetic> *                         7.5484+-0.0423    ?     7.6125+-0.0350       ? might be 1.0085x slower
   <geometric>                            6.1501+-0.0246    !     6.2034+-0.0256       ! definitely 1.0087x slower
   <harmonic>                             4.8972+-0.0219    !     4.9447+-0.0248       ! definitely 1.0097x slower

                                             BASELINE                 PATCH                                      
V8:
   crypto                                90.5244+-0.3369    ?    90.7639+-0.2440       ?
   deltablue                            180.7002+-0.7885    !   183.3483+-0.9451       ! definitely 1.0147x slower
   earley-boyer                         110.6346+-2.9285    ?   112.9138+-3.2482       ? might be 1.0206x slower
   raytrace                              59.2737+-0.3940         59.2274+-0.3765       
   regexp                               110.8469+-0.2226    !   113.0236+-0.4022       ! definitely 1.0196x slower
   richards                             161.4071+-0.2963    ?   162.0047+-0.9780       ?
   splay                                 82.6837+-0.4739    !    84.4847+-0.5265       ! definitely 1.0218x slower

   <arithmetic>                         113.7244+-0.4768    !   115.1095+-0.5764       ! definitely 1.0122x slower
   <geometric> *                        106.8071+-0.4643    !   108.0556+-0.5450       ! definitely 1.0117x slower
   <harmonic>                           100.2623+-0.4211    !   101.3228+-0.4775       ! definitely 1.0106x slower

                                             BASELINE                 PATCH                                      
Kraken:
   ai-astar                             946.2446+-1.3266    ?   946.4154+-1.0022       ?
   audio-beat-detection                 224.2164+-0.9900        223.7855+-0.9974       
   audio-dft                            329.3049+-1.0115    ?   330.1559+-0.8097       ?
   audio-fft                            139.4842+-0.1170        139.2279+-0.1638       
   audio-oscillator                     350.5775+-1.8833    ^   345.8721+-1.1269       ^ definitely 1.0136x faster
   imaging-darkroom                     346.7210+-7.7570    ?   350.4888+-10.6823      ? might be 1.0109x slower
   imaging-desaturate                   273.0441+-0.2344    ?   273.6385+-0.8707       ?
   imaging-gaussian-blur                598.4207+-0.3361    ?   599.2143+-0.5656       ?
   json-parse-financial                  71.9035+-0.3480    !    73.3239+-0.0855       ! definitely 1.0198x slower
   json-stringify-tinderbox              84.4003+-0.3435    !    89.4044+-0.5517       ! definitely 1.0593x slower
   stanford-crypto-aes                  119.5915+-0.4886    !   121.0547+-0.3671       ! definitely 1.0122x slower
   stanford-crypto-ccm                  119.4735+-0.8816    !   121.6546+-0.9818       ! definitely 1.0183x slower
   stanford-crypto-pbkdf2               227.7467+-2.5952    !   235.7733+-3.6152       ! definitely 1.0352x slower
   stanford-crypto-sha256-iterative     105.6350+-0.7371    ?   105.9827+-0.1620       ?

   <arithmetic> *                       281.1974+-0.6981    ?   282.5709+-0.8601       ? might be 1.0049x slower
   <geometric>                          213.2957+-0.5630    !   215.5104+-0.6586       ! definitely 1.0104x slower
   <harmonic>                           168.3795+-0.3955    !   171.1594+-0.4382       ! definitely 1.0165x slower

                                             BASELINE                 PATCH                                      
All benchmarks:
   <arithmetic>                         104.8743+-0.2795    !   105.5252+-0.3439       ! definitely 1.0062x slower
   <geometric>                           27.0565+-0.0833    !    27.3170+-0.0960       ! definitely 1.0096x slower
   <harmonic>                             8.6048+-0.0379    !     8.6892+-0.0427       ! definitely 1.0098x slower

                                             BASELINE                 PATCH                                      
Geomean of preferred means:
   <scaled-result>                       60.9751+-0.2058    !    61.4844+-0.2342       ! definitely 1.0084x slower


Benchmark report for SunSpider, V8, and Kraken on garen (MacPro5,1).

VMs tested:
"BASELINE" at /Volumes/Big/ggaren/baseline-webkit/WebKitBuild/Release/DumpRenderTree (r104476)
"PATCH" at /Volumes/Big/ggaren/webkit/WebKitBuild/Release/DumpRenderTree (r106297)

Collected 12 samples per benchmark/VM, with 4 VM invocations per benchmark. Emitted a call to gc() between sample
measurements. Used 1 benchmark iteration per VM invocation for warm-up. Used the portable Date.now() method to
get millisecond-level timing. Reporting benchmark execution times with 95% confidence intervals in milliseconds.

                                             BASELINE                 PATCH                                      
SunSpider:
   3d-cube                                7.5000+-0.8779    ?     7.9167+-0.7879       ? might be 1.0556x slower
   3d-morph                              10.6667+-0.4138    ?    11.1667+-0.2473       ? might be 1.0469x slower
   3d-raytrace                            9.6667+-0.6818    ?    10.0833+-0.7399       ? might be 1.0431x slower
   access-binary-trees                    2.5000+-0.5069          2.5000+-0.5069       
   access-fannkuch                        8.3333+-0.3128    ?     8.8333+-0.2473       ? might be 1.0600x slower
   access-nbody                           4.8333+-0.2473    ?     4.9167+-0.1834       ? might be 1.0172x slower
   access-nsieve                          4.1667+-0.2473          4.1667+-0.2473       
   bitops-3bit-bits-in-byte               1.5833+-0.3272    ?     1.6667+-0.3128       ? might be 1.0526x slower
   bitops-bits-in-byte                    6.3333+-0.3128    ?     6.4167+-0.3272       ? might be 1.0132x slower
   bitops-bitwise-and                     4.0000+-0.0000          3.9167+-0.1834         might be 1.0213x faster
   bitops-nsieve-bits                     6.5000+-0.3318    ?     6.5833+-0.3272       ? might be 1.0128x slower
   controlflow-recursive                  2.7500+-0.2874    ?     3.0000+-0.0000       ? might be 1.0909x slower
   crypto-aes                             9.5833+-0.8332          9.5000+-0.9954       
   crypto-md5                             2.8333+-0.2473    ?     3.2500+-0.2874       ? might be 1.1471x slower
   crypto-sha1                            2.8333+-0.2473    ?     3.0000+-0.0000       ? might be 1.0588x slower
   date-format-tofte                     14.8333+-1.4034    ?    14.9167+-1.4704       ?
   date-format-xparb                     13.3333+-1.0609         13.3333+-1.1600       
   math-cordic                            8.8333+-0.2473          8.5833+-0.3272         might be 1.0291x faster
   math-partial-sums                     12.0833+-0.1834    ?    12.1667+-0.2473       ?
   math-spectral-norm                     3.0833+-0.1834    ?     3.2500+-0.2874       ? might be 1.0541x slower
   regexp-dna                            11.0833+-0.5038         10.9167+-0.5720         might be 1.0153x faster
   string-base64                          6.1667+-0.8917    ?     6.5000+-0.9954       ? might be 1.0541x slower
   string-fasta                           9.0833+-0.7399    ?     9.2500+-0.6705       ? might be 1.0183x slower
   string-tagcloud                       15.0000+-0.5418    ?    15.5000+-0.6354       ? might be 1.0333x slower
   string-unpack-code                    26.1667+-1.2366    ?    26.8333+-1.2065       ? might be 1.0255x slower
   string-validate-input                  7.8333+-1.0434    ?     7.9167+-0.9939       ? might be 1.0106x slower

   <arithmetic> *                         8.1378+-0.4007    ?     8.3109+-0.4184       ? might be 1.0213x slower
   <geometric>                            6.5749+-0.3078    ?     6.7648+-0.3349       ? might be 1.0289x slower
   <harmonic>                             5.1409+-0.2714    ?     5.3669+-0.3144       ? might be 1.0440x slower

                                             BASELINE                 PATCH                                      
V8:
   crypto                                90.0000+-0.5418    ?    90.4167+-0.7879       ?
   deltablue                            187.2500+-4.8776    ?   188.1667+-3.2717       ?
   earley-boyer                         109.6667+-4.1561    ?   111.6667+-3.9104       ? might be 1.0182x slower
   raytrace                              59.9167+-0.5720    ?    60.4167+-0.6330       ?
   regexp                               110.0833+-0.5038    !   112.8333+-0.5956       ! definitely 1.0250x slower
   richards                             161.3333+-1.1912    ?   163.0833+-0.5720       ? might be 1.0108x slower
   splay                                108.6667+-23.3062   ?   109.4167+-23.5133      ?

   <arithmetic>                         118.1310+-4.5113    ?   119.4286+-4.3491       ? might be 1.0110x slower
   <geometric> *                        110.8475+-4.2694    ?   112.0893+-4.1895       ? might be 1.0112x slower
   <harmonic>                           103.7819+-3.7482    ?   104.9206+-3.7311       ? might be 1.0110x slower

                                             BASELINE                 PATCH                                      
Kraken:
   ai-astar                             950.0833+-3.0826    ?   950.8333+-2.1646       ?
   audio-beat-detection                 229.6667+-2.1217    ?   230.9167+-1.2550       ?
   audio-dft                            337.3333+-3.1517        335.7500+-2.2197       
   audio-fft                            142.1667+-0.5304    ?   142.5000+-0.3318       ?
   audio-oscillator                     355.8333+-2.4657    ?   358.5000+-3.0711       ?
   imaging-darkroom                     358.5833+-2.0714        357.4167+-1.3399       
   imaging-desaturate                   272.6667+-0.3128        272.5833+-0.3272       
   imaging-gaussian-blur                579.5000+-0.3318        578.7500+-0.5502       
   json-parse-financial                  74.7500+-0.3949    !    75.5000+-0.3318       ! definitely 1.0100x slower
   json-stringify-tinderbox              95.8333+-0.4560    !   100.3333+-0.6257       ! definitely 1.0470x slower
   stanford-crypto-aes                  126.4167+-1.8466    ?   126.5000+-0.8350       ?
   stanford-crypto-ccm                  137.8333+-0.8496    !   140.4167+-0.8332       ! definitely 1.0187x slower
   stanford-crypto-pbkdf2               234.5833+-0.7399    !   241.1667+-1.2946       ! definitely 1.0281x slower
   stanford-crypto-sha256-iterative     111.6667+-1.3636    ?   113.5000+-1.3133       ? might be 1.0164x slower

   <arithmetic> *                       286.2083+-0.4001    !   287.4762+-0.3627       ! definitely 1.0044x slower
   <geometric>                          221.6157+-0.4041    !   223.6166+-0.4556       ! definitely 1.0090x slower
   <harmonic>                           178.1092+-0.4351    !   180.4984+-0.5459       ! definitely 1.0134x slower

                                             BASELINE                 PATCH                                      
All benchmarks:
   <arithmetic>                         107.3493+-0.9550    ?   108.0160+-0.9514       ? might be 1.0062x slower
   <geometric>                           28.5407+-0.9017    ?    29.1188+-0.9623       ? might be 1.0203x slower
   <harmonic>                             9.0311+-0.4662    ?     9.4197+-0.5393       ? might be 1.0430x slower

                                             BASELINE                 PATCH                                      
Geomean of preferred means:
   <scaled-result>                       63.6443+-1.8583    ?    64.4252+-1.8821       ? might be 1.0123x slower


TEST                   COMPARISON            FROM                 TO             DETAILS

=============================================================================

** TOTAL **:           *1.021x as slow*  191.2ms +/- 0.2%   195.3ms +/- 0.2%     significant

=============================================================================

  3d:                  *1.055x as slow*   27.5ms +/- 0.6%    29.0ms +/- 0.2%     significant
    cube:              *1.064x as slow*    8.5ms +/- 1.7%     9.0ms +/- 0.0%     significant
    morph:             *1.098x as slow*   10.0ms +/- 0.4%    11.0ms +/- 0.5%     significant
    raytrace:          -                   9.0ms +/- 0.4%     9.0ms +/- 0.0% 

  access:              ??                 16.6ms +/- 0.8%    16.7ms +/- 0.8%     not conclusive: might be *1.005x as slow*
    binary-trees:      -                   1.0ms +/- 0.0%     1.0ms +/- 0.0% 
    fannkuch:          -                   8.0ms +/- 0.0%     8.0ms +/- 0.0% 
    nbody:             -                   4.0ms +/- 0.0%     4.0ms +/- 0.0% 
    nsieve:            ??                  3.6ms +/- 3.9%     3.7ms +/- 3.6%     not conclusive: might be *1.022x as slow*

  bitops:              ??                 15.8ms +/- 0.8%    15.8ms +/- 0.7%     not conclusive: might be *1.003x as slow*
    3bit-bits-in-byte: -                   1.0ms +/- 0.0%     1.0ms +/- 0.0% 
    bits-in-byte:      ??                  5.8ms +/- 2.1%     5.8ms +/- 2.0%     not conclusive: might be *1.007x as slow*
    bitwise-and:       -                   3.0ms +/- 0.0%     3.0ms +/- 0.0% 
    nsieve-bits:       -                   6.0ms +/- 0.0%     6.0ms +/- 0.0% 

  controlflow:         -                   2.0ms +/- 0.0%     2.0ms +/- 0.0% 
    recursive:         -                   2.0ms +/- 0.0%     2.0ms +/- 0.0% 

  crypto:              *1.088x as slow*   12.1ms +/- 0.6%    13.1ms +/- 1.5%     significant
    aes:               *1.087x as slow*    8.1ms +/- 0.8%     8.8ms +/- 1.4%     significant
    md5:               *1.180x as slow*    2.0ms +/- 0.0%     2.4ms +/- 5.8%     significant
    sha1:              -                   2.0ms +/- 0.0%     2.0ms +/- 0.0% 

  date:                *1.011x as slow*   26.2ms +/- 0.5%    26.5ms +/- 0.7%     significant
    format-tofte:      *1.034x as slow*   14.2ms +/- 0.9%    14.7ms +/- 0.9%     significant
    format-xparb:      1.017x as fast     12.0ms +/- 0.0%    11.8ms +/- 1.0%     significant

  math:                ??                 22.9ms +/- 0.4%    23.0ms +/- 0.3%     not conclusive: might be *1.005x as slow*
    cordic:            -                   8.0ms +/- 0.0%     8.0ms +/- 0.0% 
    partial-sums:      ??                 11.9ms +/- 0.6%    12.0ms +/- 0.7%     not conclusive: might be *1.008x as slow*
    spectral-norm:     ??                  3.0ms +/- 1.3%     3.0ms +/- 0.0%     not conclusive: might be *1.007x as slow*

  regexp:              ??                 12.0ms +/- 0.3%    12.0ms +/- 0.6%     not conclusive: might be *1.003x as slow*
    dna:               ??                 12.0ms +/- 0.3%    12.0ms +/- 0.6%     not conclusive: might be *1.003x as slow*

  string:              *1.017x as slow*   56.1ms +/- 0.2%    57.1ms +/- 0.2%     significant
    base64:            -                   5.0ms +/- 0.0%     5.0ms +/- 0.0% 
    fasta:             -                   8.0ms +/- 0.0%     8.0ms +/- 0.0% 
    tagcloud:          ??                 14.0ms +/- 0.3%    14.0ms +/- 0.4%     not conclusive: might be *1.001x as slow*
    unpack-code:       *1.040x as slow*   23.1ms +/- 0.4%    24.0ms +/- 0.2%     significant
    validate-input:    -                   6.0ms +/- 0.0%     6.0ms +/- 0.0%
------- Comment #2 From 2012-01-30 21:39:21 PST -------
Created an attachment (id=124669) [details]
Patch
------- Comment #3 From 2012-01-30 23:50:56 PST -------
You didn't say anything about -funwind-tables?
------- Comment #4 From 2012-01-30 23:53:04 PST -------
(In reply to comment #3)
> You didn't say anything about -funwind-tables?

-funwind-tables was only there to ensure that unwind information was generated. Some tools would fall back to that information when attempting to generate a backtrace in code that lacked frame pointers.
------- Comment #5 From 2012-01-30 23:53:40 PST -------
(From update of attachment 124669 [details])
View in context: https://bugs.webkit.org/attachment.cgi?id=124669&action=review

> Source/JavaScriptCore/Configurations/JavaScriptCore.xcconfig:52
>  OTHER_CFLAGS = $(OTHER_CFLAGS_$(CONFIGURATION)_$(CURRENT_VARIANT));

This appears to be unnecessary.
------- Comment #6 From 2012-01-31 21:25:13 PST -------
Committed r106429: <http://trac.webkit.org/changeset/106429>
------- Comment #7 From 2012-02-01 06:57:54 PST -------
Thanks for putting the motivation and data in this bug!