Skip to content

Commit 9c994b2

Browse files
committed
add notes to docs recommending -j0 in some cases
1 parent 56dd105 commit 9c994b2

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

zs/cmdline/dump.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@ def command_dump(opts):
3131
are performed using ASCIIbetical ordering.
3232
3333
Processing options:
34-
-j PARALLELISM The number of CPUs to use for decompression.
34+
-j PARALLELISM The number of CPUs to use for decompression. Note
35+
that if you know that you are only reading a small
36+
number of records, then -j0 may be the fastest
37+
option, since it reduces startup overhead.
3538
[default: guess]
39+
3640
Output options:
3741
-o FILE, --output=FILE Output to the given file, or "-" for stdout.
3842
[default: -]

zs/reader.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ class ZS(object):
220220
``parallelism="guess"`` means to spawn one worker process per available
221221
CPU.
222222
223+
Note that if you know that you are going to read just a few records on
224+
each search, then parallelism=0 may be slightly faster; this saves the
225+
overhead of setting up the worker processes, and they only really help
226+
when doing large bulk reads.
227+
223228
:arg index_block_cache: The number of index blocks to keep cached in
224229
memory. This speeds up repeated queries. Larger values provide better
225230
caching, but take more memory. Usually you'll want this to at least be

0 commit comments

Comments
 (0)