diff options
author | Björn Gustavsson <[email protected]> | 2019-02-06 14:24:51 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2019-02-11 14:54:44 +0100 |
commit | e6bdde9e927ad0933aaf36120cc740e2380567dc (patch) | |
tree | 1edd6f258afc6b6cfb6e9a477612f98cee908dbc /lib/tools/doc | |
parent | ab5debc0869dbfa64e4afd4cd59404a56ce51d71 (diff) | |
download | otp-e6bdde9e927ad0933aaf36120cc740e2380567dc.tar.gz otp-e6bdde9e927ad0933aaf36120cc740e2380567dc.tar.bz2 otp-e6bdde9e927ad0933aaf36120cc740e2380567dc.zip |
Use the counters module to speed up cover
Use `counters:add/3` instead of `ets:update_counter/3`
for counting the number of times a line is executed.
By default, the reference to the counter array for each module will be
stored in a persistent term and retrieved every time a counter is
updated. This makes the compiler test suite with coverage enabled run
*almost* twice as fast (on my computer, in about 6 minutes down from
more than 11 minutes).
To get even more speed, the new `cover:local_only/0` function can be
called to put cover into a mode where the cover-compiled code can only
be run on the local node. In this mode, the cover-compiled modules in
a more efficient way by compiling the counter reference into the
code. This shaves off about one more minute, making the compiler test
suite with coverage enabled run *more than* twice as fast (in about 5
minutes on my computer).
Diffstat (limited to 'lib/tools/doc')
-rw-r--r-- | lib/tools/doc/src/cover.xml | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/tools/doc/src/cover.xml b/lib/tools/doc/src/cover.xml index 31bf7266c7..e9f782977d 100644 --- a/lib/tools/doc/src/cover.xml +++ b/lib/tools/doc/src/cover.xml @@ -128,14 +128,26 @@ </desc> </func> <func> - <name since="">start(Nodes) -> {ok,StartedNodes} | {error,not_main_node}</name> + <name since="OTP 22.0">local_only() -> ok | {error,too_late}</name> + <fsummary>Only support running Cover on the local node.</fsummary> + <desc> + <p>Only support running Cover on the local node. This function + must be called before any modules have been compiled or any + nodes added. When running in this mode, modules will be Cover + compiled in a more efficient way, but the resulting code will + only work on the same node they were compiled on.</p> + </desc> + </func> + <func> + <name since="">start(Nodes) -> {ok,StartedNodes} | {error,not_main_node} | {error,local_only}</name> <fsummary>Start Cover on remote nodes.</fsummary> <type> <v>Nodes = StartedNodes = [atom()]</v> </type> <desc> <p>Starts a Cover server on the each of given nodes, and loads - all cover compiled modules.</p> + all cover compiled modules. This call will fail if + <c>cover:local_only/0</c> has been called.</p> </desc> </func> <func> |