Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
text
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
text
Commits
62f1c97c
Commit
62f1c97c
authored
14 years ago
by
bos
Browse files
Options
Downloads
Patches
Plain Diff
Allow decoding of multiple files when benchmarking
parent
30a05097
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/benchmarks/src/Data/Text/Benchmarks.hs
+4
-1
4 additions, 1 deletion
tests/benchmarks/src/Data/Text/Benchmarks.hs
tests/benchmarks/src/Data/Text/Benchmarks/DecodeUtf8.hs
+5
-3
5 additions, 3 deletions
tests/benchmarks/src/Data/Text/Benchmarks/DecodeUtf8.hs
with
9 additions
and
4 deletions
tests/benchmarks/src/Data/Text/Benchmarks.hs
+
4
−
1
View file @
62f1c97c
...
...
@@ -39,7 +39,10 @@ benchmarks = do
-- Traditional benchmarks
bs
<-
sequence
[
Builder
.
benchmark
,
DecodeUtf8
.
benchmark
(
tf
"russian.txt"
)
,
DecodeUtf8
.
benchmark
"xml"
(
tf
"yiwiki.xml"
)
,
DecodeUtf8
.
benchmark
"ascii"
(
tf
"ascii.txt"
)
,
DecodeUtf8
.
benchmark
"russian"
(
tf
"russian.txt"
)
,
DecodeUtf8
.
benchmark
"japanese"
(
tf
"japanese.txt"
)
,
EncodeUtf8
.
benchmark
"επανάληψη 竺法蘭共譯"
,
Equality
.
benchmark
(
tf
"japanese.txt"
)
,
FileRead
.
benchmark
(
tf
"russian.txt"
)
...
...
This diff is collapsed.
Click to expand it.
tests/benchmarks/src/Data/Text/Benchmarks/DecodeUtf8.hs
+
5
−
3
View file @
62f1c97c
...
...
@@ -23,7 +23,8 @@ import Data.ByteString.Internal (ByteString(..))
import
Foreign.Ptr
(
Ptr
,
plusPtr
)
import
Foreign.ForeignPtr
(
withForeignPtr
)
import
Data.Word
(
Word8
)
import
Criterion
(
Benchmark
,
bgroup
,
bench
,
nf
)
import
qualified
Criterion
as
C
import
Criterion
(
Benchmark
,
bgroup
,
nf
)
import
qualified
Codec.Binary.UTF8.Generic
as
U8
import
qualified
Data.ByteString
as
B
import
qualified
Data.ByteString.Lazy
as
BL
...
...
@@ -32,10 +33,11 @@ import qualified Data.Text.Encoding as T
import
qualified
Data.Text.Lazy
as
TL
import
qualified
Data.Text.Lazy.Encoding
as
TL
benchmark
::
FilePath
->
IO
Benchmark
benchmark
fp
=
do
benchmark
::
String
->
FilePath
->
IO
Benchmark
benchmark
kind
fp
=
do
bs
<-
B
.
readFile
fp
lbs
<-
BL
.
readFile
fp
let
bench
name
=
C
.
bench
(
name
++
"+"
++
kind
)
return
$
bgroup
"DecodeUtf8"
[
bench
"Strict"
$
nf
T
.
decodeUtf8
bs
,
bench
"IConv"
$
iconv
bs
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment