Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
POTTIER Francois
menhir
Commits
62e4518e
Commit
62e4518e
authored
Sep 23, 2015
by
POTTIER Francois
Browse files
Added max heap size to the statistics.
parent
20f0ae32
Changes
2
Hide whitespace changes
Inline
Side-by-side
bench/good/coverage.sh
View file @
62e4518e
...
...
@@ -15,7 +15,7 @@ make -C $SRC bootstrap || exit 1
# Remove any leftover output files.
rm
-f
log lr.csv
# Print the header of lr.csv. (This should be kept in sync with LRijkstra.ml.)
echo
"grammar,terminals,nonterminals,size,states,trie,facts,edges,time"
>
lr.csv
echo
"grammar,terminals,nonterminals,size,states,trie,facts,edges,time
,heap
"
>
lr.csv
# Try every grammar. (Only the single-file grammars, that is.)
for
f
in
`
ls
*
.mly | egrep
-v
'.*-([1-9]).mly'
`
;
do
echo
"Now dealing with:
$f
"
|
tee
-a
log
...
...
src/LRijkstra.ml
View file @
62e4518e
...
...
@@ -1161,20 +1161,25 @@ let _, _ =
end
)
let
max_heap_size
=
if
X
.
verbose
||
X
.
statistics
<>
None
then
let
stat
=
Gc
.
quick_stat
()
in
(
stat
.
Gc
.
top_heap_words
*
(
Sys
.
word_size
/
8
)
/
1024
/
1024
)
else
0
(* dummy *)
let
()
=
Time
.
tick
"Forward search"
;
if
X
.
verbose
then
begin
Printf
.
eprintf
"%d graph nodes explored by forward search.
\n
\
%d out of %d states are reachable.
\n
\
Found %d states where an error can occur.
\n
%!"
Found %d states where an error can occur.
\n
\
Maximum size reached by the major heap: %dM
\n
%!"
!
explored
(
Lr1
.
NodeSet
.
cardinal
!
reachable
)
Lr1
.
n
(
Lr1
.
NodeMap
.
cardinal
!
data
);
let
stat
=
Gc
.
quick_stat
()
in
Printf
.
eprintf
"Maximum size reached by the major heap: %dM
\n
"
(
stat
.
Gc
.
top_heap_words
*
(
Sys
.
word_size
/
8
)
/
1024
/
1024
)
(
Lr1
.
NodeMap
.
cardinal
!
data
)
max_heap_size
end
(* ------------------------------------------------------------------------ *)
...
...
@@ -1188,7 +1193,7 @@ let () =
X
.
statistics
|>
Option
.
iter
(
fun
filename
->
let
c
=
open_out_gen
[
Open_creat
;
Open_append
;
Open_text
]
0o644
filename
in
Printf
.
fprintf
c
"%s,%d,%d,%d,%d,%d,%d,%d,%.2f
\n
%!"
"%s,%d,%d,%d,%d,%d,%d,%d,%.2f
,%d
\n
%!"
(* Grammar name. *)
Settings
.
base
(* Number of terminal symbols. *)
...
...
@@ -1215,6 +1220,8 @@ let () =
(
E
.
size
()
)
(* Elapsed user time, in seconds. *)
(
stop
-.
start
)
(* Max heap size, in megabytes. *)
max_heap_size
;
close_out
c
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment