File: benchmark.hs

package info (click to toggle)
haskell-filepath-bytestring 1.4.100.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 220 kB
  • sloc: haskell: 1,278; makefile: 3
file content (21 lines) | stat: -rw-r--r-- 691 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{-# LANGUAGE OverloadedStrings #-}

import qualified System.FilePath as FilePath
import qualified System.FilePath.ByteString as RawFilePath
import Criterion.Main

main :: IO ()
main = defaultMain
	[ bgroup "combine"
		[ bench "FilePath" $ nf (FilePath.combine "foo") "bar"
		, bench "RawFilePath" $ nf (RawFilePath.combine "foo") "bar"
		]
	, bgroup "dropTrailingPathSeparator"
		[ bench "FilePath" $ nf FilePath.dropTrailingPathSeparator "foo/"
		, bench "RawFilePath" $ nf RawFilePath.dropTrailingPathSeparator "foo/"
		]
	, bgroup "FilePath conversion"
		[ bench "encode" $ nf RawFilePath.encodeFilePath "foobar.baz"
		, bench "decode" $ nf RawFilePath.decodeFilePath "foobar.baz"
		]
	]