Skip to content
Snippets Groups Projects
  • Simon Peyton Jones's avatar
    adc47ae7
    Fix worker/wrapper for CPR functions · adc47ae7
    Simon Peyton Jones authored and pcapriotti's avatar pcapriotti committed
    A long-standing and egregious bug in the worker/wrapper code meant
    that some functions with the CPR property weren't getting a CPR
    w/w. And that had the effect of making a tail-recursive function not
    tail recursive.  As well as increasing allocation.
    
    Fixes Trac #5920, and #5997.
    
    Nofib results (highlights):
    
            Program           Size    Allocs   Runtime   Elapsed  TotalMem
    --------------------------------------------------------------------------------
             boyer2          -0.1%    -15.3%      0.01      0.01     +0.0%
            mandel2          -0.0%     -8.1%      0.01      0.01     +0.0%
               para          -0.1%    -11.8%     -7.9%     -7.8%     +0.0%
    --------------------------------------------------------------------------------
                Min          -0.1%    -15.3%     -7.9%     -7.8%    -33.3%
                Max          +0.0%     +0.2%     +6.3%     +6.3%     +3.7%
     Geometric Mean          -0.0%     -0.4%     +0.1%     +0.1%     -0.5%
    
    Looks like a clear win.  And I have not even recompiled the libraries, so
    it'll probably be a bit better in the ed.
    
    MERGED from commit b8ff4448
    adc47ae7
    History
    Fix worker/wrapper for CPR functions
    Simon Peyton Jones authored and pcapriotti's avatar pcapriotti committed
    A long-standing and egregious bug in the worker/wrapper code meant
    that some functions with the CPR property weren't getting a CPR
    w/w. And that had the effect of making a tail-recursive function not
    tail recursive.  As well as increasing allocation.
    
    Fixes Trac #5920, and #5997.
    
    Nofib results (highlights):
    
            Program           Size    Allocs   Runtime   Elapsed  TotalMem
    --------------------------------------------------------------------------------
             boyer2          -0.1%    -15.3%      0.01      0.01     +0.0%
            mandel2          -0.0%     -8.1%      0.01      0.01     +0.0%
               para          -0.1%    -11.8%     -7.9%     -7.8%     +0.0%
    --------------------------------------------------------------------------------
                Min          -0.1%    -15.3%     -7.9%     -7.8%    -33.3%
                Max          +0.0%     +0.2%     +6.3%     +6.3%     +3.7%
     Geometric Mean          -0.0%     -0.4%     +0.1%     +0.1%     -0.5%
    
    Looks like a clear win.  And I have not even recompiled the libraries, so
    it'll probably be a bit better in the ed.
    
    MERGED from commit b8ff4448
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
WwLib.lhs 19.98 KiB