Optimize pprASCII

Authored by hsyl20 on Jan 17 2019, 5:01 PM.

Description

Optimize pprASCII

  • Use ByteString.foldr instead of (List.foldr . BS.unpack)
  • Avoid calling chr and its test that checks for invalid Unicode

codepoints: we stay in the ASCII range so we know we're ok

  • Avoid calling isPrint (unsafe FFI call): we can check the ASCII

printable range directly

  • Use bit operations (unsafeShiftR, .&.) instead of div and mod

Details

Committed
bgamariJan 31 2019, 11:46 AM
Parents
rGHC4fa32293c9d2: Use ByteString to represent Cmm string literals (#16198)
Branches
Unknown
Tags
Unknown