Skip to content
  • Andreas Klebinger's avatar
    4549cadf
    Make sure mkSplitUniqSupply stores the precomputed mask only. · 4549cadf
    Andreas Klebinger authored and Marge Bot's avatar Marge Bot committed
    mkSplitUniqSupply was lazy on the boxed char.
    
    This caused a bunch of issues:
    * The closure captured the boxed Char
    * The mask was recomputed on every split of the supply.
    * It also caused the allocation of MkSplitSupply to happen in it's own
    (allocated) closure. The reason of which I did not further investigate.
    
    We know force the computation of the mask inside mkSplitUniqSupply.
    * This way the mask is computed at most once per UniqSupply creation.
    * It allows ww to kick in, causing the closure to retain the unboxed
    value.
    
    Requesting Uniques in a loop is now faster by about 20%.
    
    I did not check the impact on the overall compiler, but I added a test
    to avoid regressions.
    4549cadf
    Make sure mkSplitUniqSupply stores the precomputed mask only.
    Andreas Klebinger authored and Marge Bot's avatar Marge Bot committed
    mkSplitUniqSupply was lazy on the boxed char.
    
    This caused a bunch of issues:
    * The closure captured the boxed Char
    * The mask was recomputed on every split of the supply.
    * It also caused the allocation of MkSplitSupply to happen in it's own
    (allocated) closure. The reason of which I did not further investigate.
    
    We know force the computation of the mask inside mkSplitUniqSupply.
    * This way the mask is computed at most once per UniqSupply creation.
    * It allows ww to kick in, causing the closure to retain the unboxed
    value.
    
    Requesting Uniques in a loop is now faster by about 20%.
    
    I did not check the impact on the overall compiler, but I added a test
    to avoid regressions.
Loading