Opened 3 years ago

Closed 12 months ago

#13279 closed task (fixed)

Check known-key lists

Reported by: dfeuer Owned by: dfeuer
Priority: normal Milestone: 8.8.1
Component: Compiler Version: 8.1
Keywords: newcomer Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time performance bug Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D5160
Wiki Page:

Description

I noticed that fmap (for example) has a known key

fmapName = varQual gHC_BASE    (fsLit "fmap")    fmapClassOpKey
fmapClassOpKey                = mkPreludeMiscIdUnique 173

but its RdrName doesn't refer to it.

fmap_RDR                = varQual_RDR gHC_BASE (fsLit "fmap")

Is there a reason for this? If not, it seems likely that we could get a bit of a speed-up by using fmapName here. We may also consider making liftA2 known-key for Traversable deriving.

Change History (9)

comment:1 Changed 3 years ago by RyanGlScott

This sounds like a good idea. Are we sure that valQual_RDR is always the same as nameRdrName (varQual ...)? If so, I say go for it.

comment:2 Changed 3 years ago by simonpj

Yes go for it.

comment:3 Changed 3 years ago by bgamari

Owner: set to dfeuer
Type: bugtask

comment:4 Changed 20 months ago by bgamari

Milestone: 8.4.18.6.1

This ticket won't be resolved in 8.4; remilestoning for 8.6. Do holler if you are affected by this or would otherwise like to work on it.

comment:5 Changed 15 months ago by bgamari

Keywords: newcomer added
Milestone: 8.6.18.8.1

This won't happen for 8.8 but it would be nice to quickly sort it out for 8.8.

comment:6 Changed 12 months ago by ckoparkar

Differential Rev(s): Phab:D5159
Status: newpatch

comment:7 Changed 12 months ago by ckoparkar

Differential Rev(s): Phab:D5159Phab:D5160

comment:8 Changed 12 months ago by Krzysztof Gogolewski <krz.gogolewski@…>

In 45befe2/ghc:

Use predefined known-key names when possible

Summary:
For certain entities in 'PrelNames', we were creating new 'Name's
instead of reusing the ones already defined. Easily fixed.

Test Plan: ./validate

Reviewers: dfeuer, RyanGlScott, bgamari, simonpj

Reviewed By: simonpj

Subscribers: simonpj, rwbarton, carter

GHC Trac Issues: #13279

Differential Revision: https://phabricator.haskell.org/D5160

comment:9 Changed 12 months ago by monoidal

Resolution: fixed
Status: patchclosed
Note: See TracTickets for help on using tickets.