Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
append-benchmark
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
Ben Gamari
append-benchmark
Commits
d71e9d72
Commit
d71e9d72
authored
4 years ago
by
Ben Gamari
Browse files
Options
Downloads
Patches
Plain Diff
With and without ticks
parent
055bdf57
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Main.hs
+18
-7
18 additions, 7 deletions
Main.hs
with
18 additions
and
7 deletions
Main.hs
+
18
−
7
View file @
d71e9d72
...
...
@@ -69,15 +69,13 @@ collectArgsTicks_OnStack = go mempty
in
(
e'
,
as
,
t
:
ts
)
go
as
a
=
(
a
,
as
,
[]
)
collectArgsTicksBenchmarks
::
Int
->
Benchmark
collectArgsTicksBenchmarks
len
=
bgroup
(
"length="
++
show
len
)
collectArgsTicksBenchmarks
::
Expr
->
[
Benchmark
]
collectArgsTicksBenchmarks
xs
=
[
bench
"sequence"
$
nf
(
collectArgsTicks_Seq
)
xs
,
bench
"dlist"
$
nf
(
collectArgsTicks_DList
)
xs
,
bench
"list"
$
nf
(
collectArgsTicks_List
)
xs
,
bench
"on-stack"
$
nf
(
collectArgsTicks_OnStack
)
xs
]
where
xs
=
appChain
len
collectArgs_Seq
::
Expr
->
(
Expr
,
Seq
.
Seq
Expr
)
collectArgs_Seq
=
go
mempty
...
...
@@ -110,7 +108,7 @@ collectArgs_OnStack = go
go
a
=
(
a
,
[]
)
collectArgsBenchmarks
::
Int
->
Benchmark
collectArgsBenchmarks
len
=
bgroup
(
"length="
++
show
len
)
collectArgsBenchmarks
len
=
lengthGroup
len
[
bench
"sequence"
$
nf
(
collectArgs_Seq
)
xs
,
bench
"dlist"
$
nf
(
collectArgs_DList
)
xs
,
bench
"list"
$
nf
(
collectArgs_List
)
xs
...
...
@@ -142,7 +140,7 @@ rebuild_DList = go mempty
go
acc
[]
=
toList
acc
rebuildBenchmarks
::
Int
->
Benchmark
rebuildBenchmarks
len
=
bgroup
(
"length="
++
show
len
)
rebuildBenchmarks
len
=
lengthGroup
len
[
bench
"sequence"
$
whnf
(
length
.
rebuild_Seq
)
xs
,
bench
"dlist"
$
whnf
(
length
.
rebuild_DList
)
xs
,
bench
"list"
$
whnf
(
length
.
rebuild_List
)
xs
...
...
@@ -151,9 +149,22 @@ rebuildBenchmarks len = bgroup ("length="++show len)
xs
=
[
1
..
len
]
lengths
=
[
1
,
2
,
5
,
10
,
20
,
50
,
100
,
200
]
lengthGroup
::
Int
->
[
Benchmark
]
->
Benchmark
lengthGroup
n
=
bgroup
(
"length="
++
show
n
)
main
::
IO
()
main
=
defaultMain
[
bgroup
"rebuild"
$
map
rebuildBenchmarks
lengths
,
bgroup
"collectArgs"
$
map
collectArgsBenchmarks
lengths
,
bgroup
"collectArgsTicks"
$
map
collectArgsTicksBenchmarks
lengths
,
bgroup
"collectArgsTicks"
[
bgroup
"no-ticks"
[
lengthGroup
len
$
collectArgsTicksBenchmarks
$
appChain
len
|
len
<-
lengths
]
,
bgroup
"with-ticks"
[
lengthGroup
len
$
collectArgsTicksBenchmarks
$
appTickChain
len
|
len
<-
lengths
]
]
]
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