Skip to content

Commit 23fbd9d

Browse files
author
Daniel Lemire
committed
Some tweaks.
1 parent fd44c2a commit 23fbd9d

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

doc/basics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,6 @@ parser for your CPU, is transparent and thread-safe.
513513
Backwards Compatibility
514514
-----------------------
515515

516-
The only header file supported by simdjson is simdjson.h. Older versions of simdjson published a
517-
number of other include files such as document.h or ParsedJson.h alongside simdjson.h; these headers
516+
The only header file supported by simdjson is `simdjson.h`. Older versions of simdjson published a
517+
number of other include files such as `document.h` or `ParsedJson.h` alongside `simdjson.h`; these headers
518518
may be moved or removed in future versions.

doc/parse_many.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ of magnitude cheaper. Ain't that awesome!
9797
Thread support is only active if thread supported is detected in which case the macro
9898
SIMDJSON_THREADS_ENABLED is set. Otherwise the library runs in single-thread mode.
9999

100+
A `document_stream` instance uses at most two threads: there is a main thread and a worker thread.
101+
You should expect the main thread to be fully occupied while the worker thread is partially busy
102+
(e.g., 80% of the time).
103+
100104
Support
101105
-------
102106

doc/performance.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@ are still some scenarios where tuning can enhance performance.
1111
* [Computed GOTOs](#computed-gotos)
1212
* [Number parsing](#number-parsing)
1313
* [Visual Studio](#visual-studio)
14+
* [Downclocking](#downclocking)
15+
1416

1517
Reusing the parser for maximum efficiency
1618
-----------------------------------------
1719

1820
If you're using simdjson to parse multiple documents, or in a loop, you should make a parser once
1921
and reuse it. The simdjson library will allocate and retain internal buffers between parses, keeping
20-
buffers hot in cache and keeping memory allocation and initialization to a minimum.
22+
buffers hot in cache and keeping memory allocation and initialization to a minimum. In this manner,
23+
you can parse terabytes of JSON data without doing any allocation.
2124

2225
```c++
2326
dom::parser parser;
@@ -152,3 +155,16 @@ On Intel and AMD Windows platforms, Microsoft Visual Studio enables programmers
152155
We do not recommend that you compile simdjson with architecture-specific flags such as `arch:AVX2`. The simdjson library automatically selects the best execution kernel at runtime.
153156

154157
Recent versions of Microsoft Visual Studio on Windows provides support for the LLVM Clang compiler. You only need to install the "Clang compiler" optional component. You may also get a copy of the 64-bit LLVM CLang compiler for [Windows directly from LLVM](https://releases.llvm.org/download.html). The simdjson library fully supports the LLVM Clang compiler under Windows. In fact, you may get better performance out of simdjson with the LLVM Clang compiler than with the regular Visual Studio compiler.
158+
159+
160+
Downclocking
161+
--------------
162+
163+
On some Intel processors, using SIMD instructions in a sustained manner on the same CPU core may result in a phenomenon called downclocking whereas the processor initially runs these instructions at a slow speed before reducing the frequency of the core for a short time (milliseconds). Intel refers to these states as licenses. On some current Intel processors, it occurs under two scenarios:
164+
165+
- [Whenever 512-bit AVX-512 instructions are used](https://lemire.me/blog/2018/09/07/avx-512-when-and-how-to-use-these-new-instructions/).
166+
- Whenever heavy 256-bit or wider instructions are used. Heavy instructions are those involving floating point operations or integer multiplications (since these execute on the floating point unit).
167+
168+
The simdjson library does not currently support AVX-512 instructions and it does not make use of heavy 256-bit instructions. Thus there is no downclocking due to simdjson.
169+
170+
For other reasons, you may still be worried about which SIMD instruction set is used by simdjson. Thankfully, [you can always determine and change which architecture-specific implementation is used](implementation-selection.md). Thus even if your CPU supports AVX2, you do not need to use AVX2.

0 commit comments

Comments
 (0)