@@ -251,17 +251,17 @@ largeTraversalInput = S.concat (replicate 10 byteStringData)
251251smallTraversalInput :: S. ByteString
252252smallTraversalInput = S8. pack " The quick brown fox"
253253
254- ascBuf , utfBuf :: Ptr Word8
255- ascBuf = Ptr " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" #
256- utfBuf = Ptr " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\xc0\x80 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" #
254+ asciiBuf , utf8Buf :: Ptr Word8
255+ asciiBuf = Ptr " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" #
256+ utf8Buf = Ptr " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\xc0\x80 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" #
257257
258- asclit , utflit :: Ptr Word8 -> Builder
259- asclit str@ (Ptr addr) = BI. ascLiteralCopy str (byteCountLiteral addr)
260- utflit str@ (Ptr addr) = BI. modUtf8LitCopy str (byteCountLiteral addr)
258+ asciiLit , utf8Lit :: Ptr Word8 -> Builder
259+ asciiLit str@ (Ptr addr) = BI. asciiLiteralCopy str (byteCountLiteral addr)
260+ utf8Lit str@ (Ptr addr) = BI. modUtf8LitCopy str (byteCountLiteral addr)
261261
262- ascStr , utfStr :: String
263- ascStr = " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
264- utfStr = " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
262+ asciiStr , utf8Str :: String
263+ asciiStr = " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
264+ utf8Str = " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
265265
266266main :: IO ()
267267main = do
@@ -272,15 +272,15 @@ main = do
272272 , benchB' " ensureFree 8" () (const (ensureFree 8 ))
273273 , benchB' " intHost 1" 1 intHost
274274 , benchB' " UTF-8 String (naive)" " hello world\0" fromString
275- , benchB' " UTF-8 String" () $ \ () -> utflit (Ptr " hello world\xc0\x80 " # )
275+ , benchB' " UTF-8 String" () $ \ () -> utf8Lit (Ptr " hello world\xc0\x80 " # )
276276 , benchB' " String (naive)" " hello world!" fromString
277- , benchB' " String" () $ \ () -> asclit (Ptr " hello world!" # )
278- , benchB' " AsciiLit" () $ \ () -> asclit ascBuf
279- , benchB' " Utf8Lit" () $ \ () -> utflit utfBuf
280- , benchB' " strLit" () $ \ () -> string8 ascStr
281- , benchB' " utfLit " () $ \ () -> stringUtf8 utfStr
277+ , benchB' " String" () $ \ () -> asciiLit (Ptr " hello world!" # )
278+ , benchB' " AsciiLit" () $ \ () -> asciiLit asciiBuf
279+ , benchB' " Utf8Lit" () $ \ () -> utf8Lit utf8Buf
280+ , benchB' " strLit" () $ \ () -> string8 asciiStr
281+ , benchB' " stringUtf8 " () $ \ () -> stringUtf8 utf8Str
282282 , benchB' " strLitInline" () $ \ () -> string8 " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
283- , benchB' " utfLitInline " () $ \ () -> stringUtf8 " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
283+ , benchB' " utf8LitInline " () $ \ () -> stringUtf8 " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
284284 ]
285285
286286 , bgroup " Encoding wrappers"
0 commit comments