Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.

Commit ca6fc42

Browse files
committed
Merge branch 'topic/christian/zam-baseline-tip'
* topic/christian/zam-baseline-tip: Add a quick hint for measuring ZAM's startup compilation overhead
2 parents f69038c + ab56c6f commit ca6fc42

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

scripting/optimization.rst

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,28 @@ depends heavily on several factors:
4949
this in mind when comparing Zeek runtimes, to ensure you're comparing only
5050
actual script execution time.
5151

52-
To factor out the code-generation phase, you can for example measure the time
52+
To isolate ZAM's code generation overhead when running Zeek on a pcap, simply
53+
leave out the traffic. That is, turn this ...
54+
55+
.. code-block:: sh
56+
57+
$ zcat 2009-M57-day11-18.trace.gz | zeek -O ZAM -r - <args>
58+
59+
into
60+
61+
.. code-block:: sh
62+
63+
$ time zeek -O ZAM <args>
64+
65+
and, since Zeek drops into interactive mode when run without arguments,
66+
67+
.. code-block:: sh
68+
69+
$ time zeek -O ZAM /dev/null
70+
71+
when there are none.
72+
73+
To determine the runtime after ZAM's code generation, you can measure the time
5374
between :zeek:id:`zeek_init` and :zeek:id:`zeek_done` event handlers:
5475

5576
.. code-block:: zeek

0 commit comments

Comments
 (0)