Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
copar-benchmarks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Hans-Peter Deifel
copar-benchmarks
Commits
6d4285d4
Commit
6d4285d4
authored
6 years ago
by
Hans-Peter Deifel
Browse files
Options
Downloads
Patches
Plain Diff
Add benchmarks for random DFAs
parent
dadcbdbc
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
dfa/bench.py
+33
-0
33 additions, 0 deletions
dfa/bench.py
dfa/benchmark.org
+19
-0
19 additions, 0 deletions
dfa/benchmark.org
with
53 additions
and
0 deletions
.gitignore
+
1
−
0
View file @
6d4285d4
...
...
@@ -6,3 +6,4 @@ valmari_fig4/benchmark.tex
valmari_fig4/benchmark.tmp
valmari_fig4/benchmarks.png
prism/bench/
dfa/bench/
This diff is collapsed.
Click to expand it.
dfa/bench.py
0 → 100644
+
33
−
0
View file @
6d4285d4
#!/usr/bin/env python
import
sys
import
json
import
subprocess
import
os
if
len
(
sys
.
argv
)
!=
5
:
print
(
"
Usage: %s GENERATOR MA N M
"
%
sys
.
argv
[
0
])
sys
.
exit
(
1
)
converter
=
sys
.
argv
[
1
]
ma
=
sys
.
argv
[
2
]
n
=
sys
.
argv
[
3
]
m
=
sys
.
argv
[
4
]
# Generate random dfa
os
.
makedirs
(
"
bench
"
,
exist_ok
=
True
)
filename
=
"
bench/dfa_%s_%s.coalgebra
"
%
(
n
,
m
)
subprocess
.
run
([
converter
,
n
,
m
,
filename
])
# Run ma on it
out
=
subprocess
.
run
([
ma
,
'
refine
'
,
'
--stats-json
'
,
filename
],
stdout
=
subprocess
.
DEVNULL
,
stderr
=
subprocess
.
PIPE
)
stats
=
json
.
loads
(
out
.
stderr
.
decode
(
'
utf-8
'
))
print
(
"
%s
\t
%s
\t
%s
\t
%s
\t
%s
\t
%s
\t
%s
\t
%s
\t
%s
"
%
(
n
,
m
,
stats
[
'
states
'
],
stats
[
'
edges
'
],
stats
[
'
initial-partition-size
'
],
stats
[
'
final-partition-size
'
],
stats
[
'
overall-duration
'
],
stats
[
'
parse-duration
'
],
stats
[
'
refine-duration
'
]))
This diff is collapsed.
Click to expand it.
dfa/benchmark.org
0 → 100644
+
19
−
0
View file @
6d4285d4
#+TITLE: Random DFAs
#+BEGIN_SRC sh :hlines yes :colnames '("N" "M" "Stats" "Edges" "I" "Q" "t (s)" "t_p (s)" "t_r (s)")
for n in 10 100 1000; do
for m in 10 1000; do
python bench.py ../../ma/bin/random-dfa ../../ma/bin/ma $n $m;
done
done
#+END_SRC
#+RESULTS:
| N | M | Stats | Edges | I | Q | t (s) | t_p (s) | t_r (s) |
|------+------+-------+---------+---+------+---------------+-------------+---------------|
| 10 | 10 | 20 | 110 | 3 | 20 | 0.002219078 | 0.001427121 | 0.000741096 |
| 10 | 1000 | 20 | 10010 | 3 | 20 | 0.207475028 | 0.032543624 | 0.174878671 |
| 100 | 10 | 200 | 1100 | 3 | 200 | 0.010397627 | 0.006340301 | 0.003751082 |
| 100 | 1000 | 200 | 100100 | 3 | 200 | 3.801247482 | 0.325236763 | 3.475673292 |
| 1000 | 10 | 2000 | 11000 | 3 | 2000 | 0.137027394 | 0.057381985 | 0.078047319 |
| 1000 | 1000 | 2000 | 1001000 | 3 | 2000 | 108.246297423 | 3.376023696 | 104.862454495 |
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