# \#profiling

**URL:** https://discuss.ocaml.org/tag/profiling/370.md

[Latest](https://discuss.ocaml.org/latest.md) · [Categories](https://discuss.ocaml.org/categories.md) · [Tags](https://discuss.ocaml.org/tags.md)

---

## [Announcing Pyro Caml: A Continuous Profiler for OCaml](https://discuss.ocaml.org/t/announcing-pyro-caml-a-continuous-profiler-for-ocaml/18217)

<div class="topic-metadata">

**Author:** [@ajbt200128](https://discuss.ocaml.org/u/ajbt200128)\
**Replies:** 0\
**Last updated:** [June 3, 2026, 4:58pm UTC](https://discuss.ocaml.org/t/announcing-pyro-caml-a-continuous-profiler-for-ocaml/18217 "2026-06-03T16:58:11Z")

</div>

Hey y’all, last year I gave a workshop on observability at Fun OCaml, and a few folks asked me what was available for continuous profiling, and I wasn’t aware of any solutions that supported OCaml directly. Since then I…

---

## [Back from the trenches: a tale of custom runtime events and being faster than faster](https://discuss.ocaml.org/t/back-from-the-trenches-a-tale-of-custom-runtime-events-and-being-faster-than-faster/16892)

<div class="topic-metadata">

**Author:** [@mattiasdrp](https://discuss.ocaml.org/u/mattiasdrp)\
**Replies:** 0\
**Last updated:** [June 30, 2025, 9:57am UTC](https://discuss.ocaml.org/t/back-from-the-trenches-a-tale-of-custom-runtime-events-and-being-faster-than-faster/16892 "2025-06-30T09:57:38Z")

</div>

Last week I decided to see what was possible to do with custom runtime events. I wrote this piece of code: (\*\* Operation to profile \*) let my\_slow\_op res i = res := !res + i; Unix.sleepf 0.001 (\*\* Operation to pro…

---

## [Profiling an OCaml program](https://discuss.ocaml.org/t/profiling-an-ocaml-program/16876)

<div class="topic-metadata">

**Author:** [@mattiasdrp](https://discuss.ocaml.org/u/mattiasdrp)\
**Replies:** 4\
**Last updated:** [June 27, 2025, 1:53pm UTC](https://discuss.ocaml.org/t/profiling-an-ocaml-program/16876 "2025-06-27T13:53:25Z")

</div>

I have the following code: let profile time \_n times = let total\_time = ref 0. in let res = ref 0 in for i = 1 to times do let start = time () in res := !res + i; let stop = time () in total\_time :…

---

## [OCaml 5 performance](https://discuss.ocaml.org/t/ocaml-5-performance/15014)

<div class="topic-metadata">

**Author:** [@talex5](https://discuss.ocaml.org/u/talex5)\
**Replies:** 30\
**Last updated:** [September 11, 2024, 1:06pm UTC](https://discuss.ocaml.org/t/ocaml-5-performance/15014 "2024-09-11T13:06:52Z")

</div>

I’ve been trying out some tools to investigate performance problems in my OCaml programs and I’ve written up my experiences here in case other people find it useful: OCaml 5 performance problems - Thomas Leonard's blog …

---

## [Memory profiling in 5.x](https://discuss.ocaml.org/t/memory-profiling-in-5-x/14766)

<div class="topic-metadata">

**Author:** [@viritrilbia](https://discuss.ocaml.org/u/viritrilbia)\
**Replies:** 6\
**Last updated:** [June 14, 2024, 7:46am UTC](https://discuss.ocaml.org/t/memory-profiling-in-5-x/14766 "2024-06-14T07:46:39Z")

</div>

Is there any way to profile the memory allocation of an OCaml 5.x program? I figured out how to use perf to profile the time spent by different function calls, but perf mem seems to only profile memory access rather tha…

---

## [Gprofng and OCaml?](https://discuss.ocaml.org/t/gprofng-and-ocaml/13301)

<div class="topic-metadata">

**Author:** [@Paul\_A\_Steckler](https://discuss.ocaml.org/u/Paul_A_Steckler)\
**Replies:** 0\
**Last updated:** [October 23, 2023, 7:20pm UTC](https://discuss.ocaml.org/t/gprofng-and-ocaml/13301 "2023-10-23T19:20:33Z")

</div>

Has anyone tried gprofng with OCaml? Is it at all useful?

---

## [Profiling with landmarks](https://discuss.ocaml.org/t/profiling-with-landmarks/13004)

<div class="topic-metadata">

**Author:** [@viritrilbia](https://discuss.ocaml.org/u/viritrilbia)\
**Replies:** 3\
**Last updated:** [September 12, 2023, 2:49pm UTC](https://discuss.ocaml.org/t/profiling-with-landmarks/13004 "2023-09-12T14:49:42Z")

</div>

I am trying to profile a project with landmarks but I cannot get it to work. According to the documentation it seems there are two simple ways to do this with dune. One is to add the lines (libraries landmarks) (prepr…

---

## [Memtrace, a new memory profiler for OCaml](https://discuss.ocaml.org/t/memtrace-a-new-memory-profiler-for-ocaml/6561)

<div class="topic-metadata">

**Author:** [@Yaron\_Minsky](https://discuss.ocaml.org/u/Yaron_Minsky)\
**Replies:** 3\
**Last updated:** [October 8, 2020, 8:48pm UTC](https://discuss.ocaml.org/t/memtrace-a-new-memory-profiler-for-ocaml/6561 "2020-10-08T20:48:19Z")

</div>

I thought people might be interested in this post, by Luke Maurer. It announce memtrace-viewer, which is a fancy new memory profiler for OCaml, based on the new support for statistical memory profiling, based on work …

---

## [Status of profiling in Ocaml?](https://discuss.ocaml.org/t/status-of-profiling-in-ocaml/5787)

<div class="topic-metadata">

**Author:** [@orbitz](https://discuss.ocaml.org/u/orbitz)\
**Replies:** 8\
**Last updated:** [May 18, 2020, 1:39pm UTC](https://discuss.ocaml.org/t/status-of-profiling-in-ocaml/5787 "2020-05-18T13:39:25Z")

</div>

I’m trying to profile an Ocaml program and not having much luck. gprof support is not longer present and it looks like we’re supposed to use ocamlcp and ocamloptp, but those don’t support ppx which I use in this project…
