Skip to content
GitLab
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 5,247
    • Issues 5,247
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 577
    • Merge requests 577
  • 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 CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Merge requests
  • !5846

Use quotRemWord in showWord

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Sylvain Henry requested to merge hsyl20/ghc:hsyl20/showword into master May 27, 2021
  • Overview 2
  • Commits 1
  • Pipelines 1
  • Changes 1
Use quotRemWord in showWord

Using the following high-quality benchmark (with -O2):

  main :: IO ()
  main = do
    let
      go 0         = ""
      go n@(W# n#) = showWord n# (go (n -1))
    print $ length (go 10000000)

I get the following performance results:

- remWord+quotRem: 0,76s user 0,00s system 99% cpu 0,762 total
- quotRemWord:     0,45s user 0,01s system 99% cpu 0,456 total

Note that showSignedInt already uses quotRemInt.
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: hsyl20/showword