
#14880: GHC panic: updateRole -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.2.2 checker) | Resolution: | Keywords: TypeInType Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: #15076 | Differential Rev(s): Phab:D4769 Wiki Page: | -------------------------------------+------------------------------------- Comment (by tdammers): I did some benchmarking of `Data.Map` and also `Data.IntMap` in isolation. For both, I implemented combining a large number of positive integers into a set and then testing for the presence of `-1` in the set, using two strategies: 1. the "unions" approach: `unions . map singleton` 2. the "insert" approach: `foldr insert empty` For `IntMap` (which is what we're using here), the "unions" approach is slightly faster (~14.5s vs. ~15s for 100 million elements); for `Map`, the "unions" approach is a lot faster (~6.5s vs. ~8.2s for 10 million elements). Note that this is the worst possible case for `union`, and it still outperforms individual insertions for some reason. So if that is accurate, then the idea that speeding things up by using lots of inserts instead of lots of set unions doesn't hold up. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14880#comment:56 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler