Skip to content
  • David Feuer's avatar
    51e7b007
    Speed up IntMap · 51e7b007
    David Feuer authored
    `delete`, `alter`, `update`, etc., used a `bin` smart
    constructor to avoid installing any non-root `Nil`s. Now only
    the ones that could have become `Nil` are checked, which is
    a good bit cheaper since they're in cache. `adjustWithKey`
    was implemented using `updateWithKey`, but in fact it never
    needs to worry about `Nil`s, so implementing it directly
    eliminates all such checks.
    
    Make `updateLookupWithKey` in `Data.IntMap.Lazy` strict in its
    recursive call to avoid essentially useless lazy pair allocation.
    51e7b007
    Speed up IntMap
    David Feuer authored
    `delete`, `alter`, `update`, etc., used a `bin` smart
    constructor to avoid installing any non-root `Nil`s. Now only
    the ones that could have become `Nil` are checked, which is
    a good bit cheaper since they're in cache. `adjustWithKey`
    was implemented using `updateWithKey`, but in fact it never
    needs to worry about `Nil`s, so implementing it directly
    eliminates all such checks.
    
    Make `updateLookupWithKey` in `Data.IntMap.Lazy` strict in its
    recursive call to avoid essentially useless lazy pair allocation.
Loading