Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,862
    • Issues 4,862
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 455
    • Merge requests 455
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #21217
Closed
Open
Created Mar 10, 2022 by jwaldmann@jwaldmann

ghc.compiler.GHC.Cmm.Switch.restrictMap could be more efficient

The first split

restrictMap :: (Integer,Integer) -> M.Map Integer b -> M.Map Integer b 
restrictMap (lo,hi) m = mid   where
  (_,   mid_hi) = M.split (lo-1) m
  (mid, _) =      M.split (hi+1) mid_hi

might do useless work when the result map is small. See discussion at https://github.com/haskell/containers/pull/803#issuecomment-1062968905

But .. if it did not show up in profiles before, then perhaps it does not need to be fixed. Anyway I thought I'd mention it here.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking