Skip to content

Commit 96b6a65

Browse files
authored
Update Logbook (#441)
1 parent 322f85a commit 96b6a65

File tree

3 files changed

+102
-3
lines changed

3 files changed

+102
-3
lines changed

Logbook.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,99 @@
11
# Leios logbook
22

3+
## 2025-07-02
4+
5+
### Trace verifier performance
6+
7+
#### GC parameters
8+
9+
Running the `leios-trace-verifier` with a minimum heap size of 1G improves the performance by a factor 3
10+
11+
```bash
12+
yves@nucli ~/code/ouroboros-leios (yveshauser/full-short-leios-trace-verifier)$ nix run .#leios-trace-verifier -- +RTS -H1G -s -RTS --trace-file sim-rs-late.out --config-file data/simulation/config.default.yaml --topology-file leios-trace-verifier/examples/topology.yaml --idSut 0
13+
Applying 25681 actions
14+
220,151,201,640 bytes allocated in the heap
15+
853,676,864 bytes copied during GC
16+
115,103,776 bytes maximum residency (6 sample(s))
17+
595,936 bytes maximum slop
18+
1054 MiB total memory in use (0 MiB lost due to fragmentation)
19+
20+
Tot time (elapsed) Avg pause Max pause
21+
Gen 0 249 colls, 0 par 0.756s 0.757s 0.0030s 0.0256s
22+
Gen 1 6 colls, 0 par 0.181s 0.182s 0.0303s 0.0863s
23+
24+
INIT time 0.000s ( 0.000s elapsed)
25+
MUT time 40.668s ( 40.676s elapsed)
26+
GC time 0.937s ( 0.939s elapsed)
27+
EXIT time 0.000s ( 0.000s elapsed)
28+
Total time 41.606s ( 41.615s elapsed)
29+
30+
%GC time 0.0% (0.0% elapsed)
31+
32+
Alloc rate 5,413,366,479 bytes per MUT second
33+
34+
Productivity 97.7% of total user, 97.7% of total elapsed
35+
```
36+
Without the parameter specificing the minium heap size:
37+
```bash
38+
yves@nucli$ nix run .#leios-trace-verifier -- +RTS -s -RTS --trace-file sim-rs-late.out --config-file data/simulation/config.default.yaml --topology-file leios-trace-verifier/examples/topology.yaml --idSut 0
39+
Applying 25681 actions
40+
220,162,801,512 bytes allocated in the heap
41+
141,347,876,600 bytes copied during GC
42+
128,132,840 bytes maximum residency (545 sample(s))
43+
1,442,904 bytes maximum slop
44+
378 MiB total memory in use (0 MiB lost due to fragmentation)
45+
46+
Tot time (elapsed) Avg pause Max pause
47+
Gen 0 52944 colls, 0 par 47.181s 47.246s 0.0009s 0.0050s
48+
Gen 1 545 colls, 0 par 41.029s 41.065s 0.0753s 0.0996s
49+
50+
INIT time 0.000s ( 0.000s elapsed)
51+
MUT time 28.803s ( 28.745s elapsed)
52+
GC time 88.210s ( 88.311s elapsed)
53+
EXIT time 0.000s ( 0.000s elapsed)
54+
Total time 117.014s (117.056s elapsed)
55+
56+
%GC time 0.0% (0.0% elapsed)
57+
58+
Alloc rate 7,643,769,348 bytes per MUT second
59+
60+
Productivity 24.6% of total user, 24.6% of total elapsed
61+
```
62+
#### Profiling
63+
In order to spot performance bottle-necks in the `leios-trace-verifier` executable, we can enable profiling as follows:
64+
65+
- Uncomment the profiling parameters in [project.nix](nix/project.nix)
66+
- Run the `leios-trace-verifier` with the additional command line argument `-pj` to produce a profiling output file
67+
68+
```bash
69+
yves@nucli ~/code/ouroboros-leios (yveshauser/full-short-leios-trace-verifier)$ nix run .#leios-trace-verifier -- +RTS -pj -H1G -s -RTS --trace-file sim-rs-late.out --config-file data/simulation/config.default.yaml --topology-file leios-trace-verifier/examples/topology.yaml --idSut 0
70+
Applying 25681 actions
71+
340,498,733,272 bytes allocated in the heap
72+
1,762,895,112 bytes copied during GC
73+
182,540,568 bytes maximum residency (6 sample(s))
74+
1,505,000 bytes maximum slop
75+
1235 MiB total memory in use (0 MiB lost due to fragmentation)
76+
77+
Tot time (elapsed) Avg pause Max pause
78+
Gen 0 406 colls, 0 par 1.250s 1.252s 0.0031s 0.0200s
79+
Gen 1 6 colls, 0 par 0.224s 0.224s 0.0374s 0.0975s
80+
81+
INIT time 0.001s ( 0.001s elapsed)
82+
MUT time 87.775s ( 87.512s elapsed)
83+
GC time 1.475s ( 1.476s elapsed)
84+
RP time 0.000s ( 0.000s elapsed)
85+
PROF time 0.000s ( 0.000s elapsed)
86+
EXIT time 0.000s ( 0.000s elapsed)
87+
Total time 89.251s ( 88.989s elapsed)
88+
89+
%GC time 0.0% (0.0% elapsed)
90+
91+
Alloc rate 3,879,203,434 bytes per MUT second
92+
93+
Productivity 98.3% of total user, 98.3% of total elapsed
94+
```
95+
- Inspect the `leios-trace-verifier.prof` file in [speedscope](https://www.speedscope.app/)
96+
397
## 2025-06-30
498

599
### Praos simulations

leios-trace-verifier/hs-src/trace-parser.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ executable leios-trace-verifier
5151
, yaml
5252

5353
default-language: Haskell2010
54-
ghc-options: -Wall -Werror
54+
ghc-options: -Wall -Werror -rtsopts
5555

5656
test-suite test-trace-verifier
5757
type: exitcode-stdio-1.0

nix/project.nix

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,13 @@ let
4949
"https://chap.intersectmbo.org/" = inputs.iogx.inputs.CHaP;
5050
};
5151
name = "ouroboros-leios";
52-
compiler-nix-name = lib.mkDefault "ghc982";
53-
# modules = [{ packages = { }; } { packages = { }; } ];
52+
compiler-nix-name = lib.mkDefault "ghc9101";
53+
modules = [
54+
{ #enableLibraryProfiling = true;
55+
#enableProfiling = true;
56+
#profilingDetail = "late";
57+
}
58+
];
5459
});
5560

5661
cabalProject = cabalProject'.appendOverlays [ ];

0 commit comments

Comments
 (0)