Skip to content

Commit 7a1c50e

Browse files
committed
profiling doc
1 parent c4a6960 commit 7a1c50e

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

Makefile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,6 @@ trace:
1919
RUST_LOG=warn,dkn_compute=trace,libp2p=debug \
2020
cargo run --bin dkn-compute
2121

22-
.PHONY: profile-cpu # | Profile CPU usage with flamegraph
23-
profile-cpu:
24-
DKN_EXIT_TIMEOUT=120 cargo flamegraph --root --profile=profiling --bin dkn-compute
25-
26-
.PHONY: profile-mem # | Profile memory usage with instruments
27-
profile-mem:
28-
DKN_EXIT_TIMEOUT=120 cargo instruments --profile=profiling -t Allocations --bin dkn-compute
29-
3022
.PHONY: ollama-versions
3123
ollama-versions:
3224
@cat Cargo.lock | grep "https://github.com/andthattoo/ollama-workflows"

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Furthermore, the profiling build will exit automatically after a certain time, a
123123
**CPU Profiling**: To create a [flamegraph](https://crates.io/crates/flamegraph) of the application, the command below will create a profiling build that inherits `release` mode, except with debug information:
124124

125125
```sh
126-
make profile-cpu
126+
DKN_EXIT_TIMEOUT=120 cargo flamegraph --root --profile=profiling --bin dkn-compute
127127
```
128128

129129
> [!NOTE]
@@ -133,9 +133,13 @@ make profile-cpu
133133
**Memory Profiling**: To profile memory usage, we make use of [cargo-instruments](https://crates.io/crates/cargo-instruments):
134134

135135
```sh
136-
make profile-mem
136+
DKN_EXIT_TIMEOUT=120 cargo instruments --profile=profiling -t Allocations --bin dkn-compute
137137
```
138138

139+
> [!TIP]
140+
>
141+
> You can adjust the profiling duration via the `DKN_EXIT_TIMEOUT` variable, which takes a number of seconds until termination.
142+
139143
## License
140144

141145
This project is licensed under the [Apache License 2.0](https://opensource.org/license/Apache-2.0).

0 commit comments

Comments
 (0)