mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
fix several typos (#2348)
This commit is contained in:
+1
-1
@@ -92,7 +92,7 @@ We welcome contributions from women and less represented groups. If you need hel
|
||||
|
||||
Consider the following points when engaging with the project:
|
||||
|
||||
- We discourage arguments from authority: ideas are discusssed on their own merits and not based on who stated it.
|
||||
- We discourage arguments from authority: ideas are discussed on their own merits and not based on who stated it.
|
||||
- Be mindful that what you may view as an aggression is maybe merely a difference of opinion or a misunderstanding.
|
||||
- Be mindful that a collection of small aggressions, even if mild in isolation, can become harmful.
|
||||
|
||||
|
||||
+2
-2
@@ -1531,7 +1531,7 @@ Some errors are recoverable:
|
||||
* You may get the error `simdjson::INCORRECT_TYPE` after trying to convert a value to an incorrect type: e.g., you expected a number and try to convert the value to a number, but it is an array.
|
||||
* You may query a key from an object, but the key is missing in which case you get the error `simdjson::NO_SUCH_FIELD`: e.g., you call `obj["myname"]` and the object does not have a key `"myname"`.
|
||||
|
||||
Other errors (`simdjson::INCOMPLETE_ARRAY_OR_OBJECT` and `simdjson::TAPE_ERROR`) indicate a fatal error and follow from the fact that the document is not valid JSON. These errors are not recoverable: you cannot continue. In which case, it is no longer safe to continue accessing the document: calling the method `is_alive()` on the document instance returns false. It is your responsability as a user to stop using the simdjson
|
||||
Other errors (`simdjson::INCOMPLETE_ARRAY_OR_OBJECT` and `simdjson::TAPE_ERROR`) indicate a fatal error and follow from the fact that the document is not valid JSON. These errors are not recoverable: you cannot continue. In which case, it is no longer safe to continue accessing the document: calling the method `is_alive()` on the document instance returns false. It is your responsibility as a user to stop using the simdjson
|
||||
document after encountering these fatal errors. Consider the following example, after
|
||||
the fatal error, the document instance cannot be used. Observe how the JSON input is invalid.
|
||||
```cpp
|
||||
@@ -2558,7 +2558,7 @@ The CPU detection, which runs the first time parsing is attempted and switches t
|
||||
parser for your CPU, is transparent and thread-safe.
|
||||
Our runtime dispatching is based on global objects that are instantiated at the beginning of the
|
||||
main thread and may be discarded at the end of the main thread. If you have multiple threads running
|
||||
and some threads use the library while the main thread is cleaning up ressources, you may encounter
|
||||
and some threads use the library while the main thread is cleaning up resources, you may encounter
|
||||
issues. If you expect such problems, you may consider using [std::quick_exit](https://en.cppreference.com/w/cpp/utility/program/quick_exit).
|
||||
|
||||
In a threaded environment, stack space is often limited. Running code like simdjson in debug mode may require hundreds of kilobytes of stack memory. Thus stack overflows are a possibility. We recommend you turn on optimization when working in an environment where stack space is limited. If you must run your code in debug mode, we recommend you configure your system to have more stack space. We discourage you from running production code based on a debug build.
|
||||
|
||||
+1
-1
@@ -733,5 +733,5 @@ Setting the `realloc_if_needed` parameter `false` in this manner may lead to bet
|
||||
Performance Tips
|
||||
---------------------
|
||||
|
||||
- For release builds, we recommend setting `NDEBUG` pre-processor directive when compiling the `simdjson` library. Importantly, using the optimization flags `-O2` or `-O3` under GCC and LLVM clang does not set the `NDEBUG` directrive, you must set it manually (e.g., `-DNDEBUG`).
|
||||
- For release builds, we recommend setting `NDEBUG` pre-processor directive when compiling the `simdjson` library. Importantly, using the optimization flags `-O2` or `-O3` under GCC and LLVM clang does not set the `NDEBUG` directive, you must set it manually (e.g., `-DNDEBUG`).
|
||||
- For long streams of JSON documents, consider [`iterate_many`](iterate_many.md) and [`parse_many`](parse_many.md) for better performance.
|
||||
|
||||
+1
-1
@@ -367,7 +367,7 @@ Please see our main documentation (`basics.md`) under
|
||||
"Use `tag_invoke` for custom types (C++20)" for details about
|
||||
tag_invoke functions.
|
||||
|
||||
Given a stream of JSON documents, you can add them to a data struture
|
||||
Given a stream of JSON documents, you can add them to a data structure
|
||||
such as a `std::vector<Car>` like so if you support exceptions:
|
||||
|
||||
```C++
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
* The memory allocation is strict: you
|
||||
* can you use this function to increase
|
||||
* or lower the amount of allocated memory.
|
||||
* Passsing zero clears the memory.
|
||||
* Passing zero clears the memory.
|
||||
*/
|
||||
error_code allocate(size_t len) noexcept;
|
||||
/** @private Capacity in bytes, in terms
|
||||
|
||||
@@ -340,7 +340,7 @@ public:
|
||||
* arrays or objects) MUST be separated with whitespace.
|
||||
*
|
||||
* The documents must not exceed batch_size bytes (by default 1MB) or they will fail to parse.
|
||||
* Setting batch_size to excessively large or excesively small values may impact negatively the
|
||||
* Setting batch_size to excessively large or excessively small values may impact negatively the
|
||||
* performance.
|
||||
*
|
||||
* ### Error Handling
|
||||
@@ -434,7 +434,7 @@ public:
|
||||
* arrays or objects) MUST be separated with whitespace.
|
||||
*
|
||||
* The documents must not exceed batch_size bytes (by default 1MB) or they will fail to parse.
|
||||
* Setting batch_size to excessively large or excesively small values may impact negatively the
|
||||
* Setting batch_size to excessively large or excessively small values may impact negatively the
|
||||
* performance.
|
||||
*
|
||||
* ### Error Handling
|
||||
|
||||
@@ -137,7 +137,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
||||
// floor(log(5**power)/log(2))
|
||||
//
|
||||
// Note that this is not magic: 152170/(1<<16) is
|
||||
// approximatively equal to log(5)/log(2).
|
||||
// approximately equal to log(5)/log(2).
|
||||
// The 1<<16 value is a power of two; we could use a
|
||||
// larger power of 2 if we wanted to.
|
||||
//
|
||||
|
||||
@@ -6787,7 +6787,7 @@ public:
|
||||
* The memory allocation is strict: you
|
||||
* can you use this function to increase
|
||||
* or lower the amount of allocated memory.
|
||||
* Passsing zero clears the memory.
|
||||
* Passing zero clears the memory.
|
||||
*/
|
||||
error_code allocate(size_t len) noexcept;
|
||||
/** @private Capacity in bytes, in terms
|
||||
@@ -9185,7 +9185,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
||||
// floor(log(5**power)/log(2))
|
||||
//
|
||||
// Note that this is not magic: 152170/(1<<16) is
|
||||
// approximatively equal to log(5)/log(2).
|
||||
// approximately equal to log(5)/log(2).
|
||||
// The 1<<16 value is a power of two; we could use a
|
||||
// larger power of 2 if we wanted to.
|
||||
//
|
||||
@@ -15545,7 +15545,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
||||
// floor(log(5**power)/log(2))
|
||||
//
|
||||
// Note that this is not magic: 152170/(1<<16) is
|
||||
// approximatively equal to log(5)/log(2).
|
||||
// approximately equal to log(5)/log(2).
|
||||
// The 1<<16 value is a power of two; we could use a
|
||||
// larger power of 2 if we wanted to.
|
||||
//
|
||||
@@ -21769,7 +21769,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
||||
// floor(log(5**power)/log(2))
|
||||
//
|
||||
// Note that this is not magic: 152170/(1<<16) is
|
||||
// approximatively equal to log(5)/log(2).
|
||||
// approximately equal to log(5)/log(2).
|
||||
// The 1<<16 value is a power of two; we could use a
|
||||
// larger power of 2 if we wanted to.
|
||||
//
|
||||
@@ -28149,7 +28149,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
||||
// floor(log(5**power)/log(2))
|
||||
//
|
||||
// Note that this is not magic: 152170/(1<<16) is
|
||||
// approximatively equal to log(5)/log(2).
|
||||
// approximately equal to log(5)/log(2).
|
||||
// The 1<<16 value is a power of two; we could use a
|
||||
// larger power of 2 if we wanted to.
|
||||
//
|
||||
@@ -34891,7 +34891,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
||||
// floor(log(5**power)/log(2))
|
||||
//
|
||||
// Note that this is not magic: 152170/(1<<16) is
|
||||
// approximatively equal to log(5)/log(2).
|
||||
// approximately equal to log(5)/log(2).
|
||||
// The 1<<16 value is a power of two; we could use a
|
||||
// larger power of 2 if we wanted to.
|
||||
//
|
||||
@@ -41457,7 +41457,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
||||
// floor(log(5**power)/log(2))
|
||||
//
|
||||
// Note that this is not magic: 152170/(1<<16) is
|
||||
// approximatively equal to log(5)/log(2).
|
||||
// approximately equal to log(5)/log(2).
|
||||
// The 1<<16 value is a power of two; we could use a
|
||||
// larger power of 2 if we wanted to.
|
||||
//
|
||||
@@ -47468,7 +47468,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
||||
// floor(log(5**power)/log(2))
|
||||
//
|
||||
// Note that this is not magic: 152170/(1<<16) is
|
||||
// approximatively equal to log(5)/log(2).
|
||||
// approximately equal to log(5)/log(2).
|
||||
// The 1<<16 value is a power of two; we could use a
|
||||
// larger power of 2 if we wanted to.
|
||||
//
|
||||
@@ -53078,7 +53078,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
||||
// floor(log(5**power)/log(2))
|
||||
//
|
||||
// Note that this is not magic: 152170/(1<<16) is
|
||||
// approximatively equal to log(5)/log(2).
|
||||
// approximately equal to log(5)/log(2).
|
||||
// The 1<<16 value is a power of two; we could use a
|
||||
// larger power of 2 if we wanted to.
|
||||
//
|
||||
|
||||
+11
-11
@@ -4656,7 +4656,7 @@ public:
|
||||
* The memory allocation is strict: you
|
||||
* can you use this function to increase
|
||||
* or lower the amount of allocated memory.
|
||||
* Passsing zero clears the memory.
|
||||
* Passing zero clears the memory.
|
||||
*/
|
||||
error_code allocate(size_t len) noexcept;
|
||||
/** @private Capacity in bytes, in terms
|
||||
@@ -5013,7 +5013,7 @@ public:
|
||||
* arrays or objects) MUST be separated with whitespace.
|
||||
*
|
||||
* The documents must not exceed batch_size bytes (by default 1MB) or they will fail to parse.
|
||||
* Setting batch_size to excessively large or excesively small values may impact negatively the
|
||||
* Setting batch_size to excessively large or excessively small values may impact negatively the
|
||||
* performance.
|
||||
*
|
||||
* ### Error Handling
|
||||
@@ -5107,7 +5107,7 @@ public:
|
||||
* arrays or objects) MUST be separated with whitespace.
|
||||
*
|
||||
* The documents must not exceed batch_size bytes (by default 1MB) or they will fail to parse.
|
||||
* Setting batch_size to excessively large or excesively small values may impact negatively the
|
||||
* Setting batch_size to excessively large or excessively small values may impact negatively the
|
||||
* performance.
|
||||
*
|
||||
* ### Error Handling
|
||||
@@ -11599,7 +11599,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
||||
// floor(log(5**power)/log(2))
|
||||
//
|
||||
// Note that this is not magic: 152170/(1<<16) is
|
||||
// approximatively equal to log(5)/log(2).
|
||||
// approximately equal to log(5)/log(2).
|
||||
// The 1<<16 value is a power of two; we could use a
|
||||
// larger power of 2 if we wanted to.
|
||||
//
|
||||
@@ -13707,7 +13707,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
||||
// floor(log(5**power)/log(2))
|
||||
//
|
||||
// Note that this is not magic: 152170/(1<<16) is
|
||||
// approximatively equal to log(5)/log(2).
|
||||
// approximately equal to log(5)/log(2).
|
||||
// The 1<<16 value is a power of two; we could use a
|
||||
// larger power of 2 if we wanted to.
|
||||
//
|
||||
@@ -16307,7 +16307,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
||||
// floor(log(5**power)/log(2))
|
||||
//
|
||||
// Note that this is not magic: 152170/(1<<16) is
|
||||
// approximatively equal to log(5)/log(2).
|
||||
// approximately equal to log(5)/log(2).
|
||||
// The 1<<16 value is a power of two; we could use a
|
||||
// larger power of 2 if we wanted to.
|
||||
//
|
||||
@@ -18904,7 +18904,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
||||
// floor(log(5**power)/log(2))
|
||||
//
|
||||
// Note that this is not magic: 152170/(1<<16) is
|
||||
// approximatively equal to log(5)/log(2).
|
||||
// approximately equal to log(5)/log(2).
|
||||
// The 1<<16 value is a power of two; we could use a
|
||||
// larger power of 2 if we wanted to.
|
||||
//
|
||||
@@ -21618,7 +21618,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
||||
// floor(log(5**power)/log(2))
|
||||
//
|
||||
// Note that this is not magic: 152170/(1<<16) is
|
||||
// approximatively equal to log(5)/log(2).
|
||||
// approximately equal to log(5)/log(2).
|
||||
// The 1<<16 value is a power of two; we could use a
|
||||
// larger power of 2 if we wanted to.
|
||||
//
|
||||
@@ -24649,7 +24649,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
||||
// floor(log(5**power)/log(2))
|
||||
//
|
||||
// Note that this is not magic: 152170/(1<<16) is
|
||||
// approximatively equal to log(5)/log(2).
|
||||
// approximately equal to log(5)/log(2).
|
||||
// The 1<<16 value is a power of two; we could use a
|
||||
// larger power of 2 if we wanted to.
|
||||
//
|
||||
@@ -27157,7 +27157,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
||||
// floor(log(5**power)/log(2))
|
||||
//
|
||||
// Note that this is not magic: 152170/(1<<16) is
|
||||
// approximatively equal to log(5)/log(2).
|
||||
// approximately equal to log(5)/log(2).
|
||||
// The 1<<16 value is a power of two; we could use a
|
||||
// larger power of 2 if we wanted to.
|
||||
//
|
||||
@@ -29678,7 +29678,7 @@ simdjson_inline bool compute_float_64(int64_t power, uint64_t i, bool negative,
|
||||
// floor(log(5**power)/log(2))
|
||||
//
|
||||
// Note that this is not magic: 152170/(1<<16) is
|
||||
// approximatively equal to log(5)/log(2).
|
||||
// approximately equal to log(5)/log(2).
|
||||
// The 1<<16 value is a power of two; we could use a
|
||||
// larger power of 2 if we wanted to.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user