Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
stm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Glasgow Haskell Compiler
Packages
stm
Commits
3925cc1a
Commit
3925cc1a
authored
1 year ago
by
konsumlamm
Browse files
Options
Downloads
Patches
Plain Diff
Use `async` for benchmarks & remove Makefile
parent
34cc1f19
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
bench/Async.hs
+0
-17
0 additions, 17 deletions
bench/Async.hs
bench/ChanBench.hs
+1
-2
1 addition, 2 deletions
bench/ChanBench.hs
bench/Makefile
+0
-6
0 additions, 6 deletions
bench/Makefile
bench/stm-bench.cabal
+1
-3
1 addition, 3 deletions
bench/stm-bench.cabal
with
2 additions
and
28 deletions
bench/Async.hs
deleted
100644 → 0
+
0
−
17
View file @
34cc1f19
module
Async
where
import
Control.Concurrent
(
forkIO
)
import
Control.Concurrent.MVar
newtype
Async
a
=
Async
(
MVar
a
)
async
::
IO
a
->
IO
(
Async
a
)
async
action
=
do
mvar
<-
newEmptyMVar
_
<-
forkIO
$
do
x
<-
action
putMVar
mvar
x
pure
(
Async
mvar
)
wait
::
Async
a
->
IO
a
wait
(
Async
a
)
=
takeMVar
a
This diff is collapsed.
Click to expand it.
bench/ChanBench.hs
+
1
−
2
View file @
3925cc1a
{-# LANGUAGE AllowAmbiguousTypes, ScopedTypeVariables, RankNTypes, TypeApplications #-}
import
Control.Concurrent.Async
import
Control.Monad
import
Data.Foldable
(
traverse_
)
import
System.Environment
...
...
@@ -11,8 +12,6 @@ import Control.Concurrent.STM
import
Control.Concurrent.STM.TQueue
import
Control.Concurrent.STM.TBQueue
import
Async
class
Channel
c
where
newc
::
IO
(
c
a
)
readc
::
c
a
->
IO
a
...
...
This diff is collapsed.
Click to expand it.
bench/Makefile
deleted
100644 → 0
+
0
−
6
View file @
34cc1f19
GHC
=
ghc
# Run chanbench for 4 different channel types, 3 different benchmarks
all
:
for
i
in
CHAN TCHAN TQUEUE TBQUEUE
;
do
$(
GHC
)
-D
$$
i
-O2
-fforce-recomp
chanbench.hs
-o
chanbench-
$$
i
;
done
for
i
in
0 1 2
;
do
echo
;
echo
===
test
$$
i
===
;
for
j
in
CHAN TCHAN TQUEUE TBQUEUE
;
do
printf
"%-10s"
$$
j
;
time
./chanbench-
$$
j
$$
i 2000000
;
done
;
done
This diff is collapsed.
Click to expand it.
bench/stm-bench.cabal
+
1
−
3
View file @
3925cc1a
...
...
@@ -13,8 +13,6 @@ description:
benchmark chanbench
type: exitcode-stdio-1.0
main-is: ChanBench.hs
other-modules:
Async
build-depends: base, stm, tasty, tasty-bench
build-depends: base, stm, async, tasty, tasty-bench
default-language: Haskell2010
ghc-options: -O2 -threaded -with-rtsopts=-N
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