Bryan O'Sullivan avatar Bryan O'Sullivan committed b178a67

Merge

Comments (0)

Files changed (2)

benchmarks/Benchmarks.hs

 printf2 :: (P.PrintfArg a, P.PrintfArg b) => String -> (a,b) -> String
 printf2 f (a,b) = P.printf f a b
 
+printf3 :: (P.PrintfArg a, P.PrintfArg b, P.PrintfArg c) =>
+           String -> (a,b,c) -> String
+printf3 f (a,b,c) = P.printf f a b c
+
 main = defaultMain [
          bgroup "arity" [
            bench "0" $ nf (format "hi") ()
          , bench "format2" $ nf (format "hi mom {} {}\n") (pi::Double, "yeah"::T.Text)
          , bench "printf2" $ nf (printf2 "hi mom %f %s\n") (pi::Double, "yeah"::String)
          , bench "show2" $ nf (\(d,s) -> "hi mom " ++ show d ++ " " ++ show s ++ "\n") (pi::Double, "yeah"::String)
+         , bench "format3" $ nf (format "hi mom {} {} {}\n") (pi::Double, "yeah"::T.Text, 21212121::Int)
+         , bench "printf3" $ nf (printf3 "hi mom %f %s %d\n") (pi::Double, "yeah"::String, 21212121::Int)
          ]
        , bgroup "types" [
            bench "unit" $ nf (format "hi") ()

benchmarks/Simple.hs

   let t = T.format "hi mom {}\n" (Only i)
   L.putStr . encodeUtf8 $ t
 
+bigint count = counting count $ \i x -> do
+  let t = T.format "hi mom {}\n" (Only (i+100000))
+  L.putStr . encodeUtf8 $ t
+
 double count = counting count $ \i x -> do
   let t = T.format "hi mom {}\n" (Only (fromIntegral i * dpi))
   L.putStr . encodeUtf8 $ t
              ("double":_) -> double
              ("p6":_) -> p6
              ("int":_)    -> int
+             ("bigint":_) -> bigint
              ("one":_)    -> one
              ("two":_)    -> two
              ("three":_)  -> three
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.