Ticket #3055 (new bug)

Opened 3 years ago

Last modified 4 months ago

Int / Word / IntN / WordN are unequally optimized

Reported by: claus Owned by:
Priority: lowest Milestone: 7.6.1
Component: Compiler Version: 6.11
Keywords: Cc: merehap@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Runtime performance bug Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

A lot of thought has been put into optimizing usage of Int, but not all of these tweaks have been copied for usage of Word, and the specific-size versions of both have even fewer optimizations. The consequence is that switching from signed to unsigned, or from unspecified to specified size, can result in dramatic performance loss.

- builtin rules (prelude/PrelRules) cover Int and Word, but not sized alternatives

- SPECIALI[SZ]E pragmas cover Int, but little of the others. Try

find libraries/ -name _darcs -prune -o -name *hs | 
  xargs grep SPECIAL | grep '\<Int\|\<Word'

- some instances have special cases for Int, but not for the others (for instance, the Enum instance for Int uses specialised enumFromTo code, the Word version uses generic code; base/GHC/Enum.hs and base/GHC/Word.hs)

- some RULES help optimizing the special cases for Int further (again, see the Enum instance for Int for an example)

See this thread  Int vs Word performance? for more discussion.

related tickets: #2270, #3051

Change History

Changed 3 years ago by igloo

  • difficulty set to Unknown
  • milestone set to 6.12.1

Changed 3 years ago by igloo

  • owner set to igloo

Changed 3 years ago by simonmar

  • failure set to Runtime performance bug

Changed 3 years ago by igloo

  • owner igloo deleted
  • milestone changed from 6.12.1 to 6.12 branch

Changed 2 years ago by igloo

  • milestone changed from 6.12 branch to 6.12.3

Changed 2 years ago by merehap

  • cc merehap@… added

Changed 2 years ago by igloo

  • priority changed from normal to low
  • milestone changed from 6.12.3 to 6.14.1

Changed 18 months ago by igloo

  • milestone changed from 7.0.1 to 7.0.2

Changed 15 months ago by igloo

  • milestone changed from 7.0.2 to 7.2.1

Changed 8 months ago by igloo

  • milestone changed from 7.2.1 to 7.4.1

Changed 4 months ago by igloo

  • priority changed from low to lowest
  • milestone changed from 7.4.1 to 7.6.1
Note: See TracTickets for help on using tickets.