
#8173: GHC uses nub -------------------------------------+------------------------------------- Reporter: nh2 | Owner: leroux Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Compile-time | Difficulty: Moderate (less performance bug | than a day) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Comment (by nh2): Replying to [comment:9 leroux]:
hvr has pointed out that having cases for `[]`, `[a]`, and `[a, b]` will most probably prevent the overhead from using Set for trivial calls.
Before you implement that, have you already found out why ordNub even is faster on singleton list? It is weird, but I am not joking: `ordNub [1]` is slightly faster than `nub [1]` in my Criterion benchmark. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8173#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler