|
15 | 15 |
|
16 | 16 | ### CPU target
|
17 | 17 |
|
18 |
| -For taking advantage of simdjson your system needs to be SIMD compatible. This means to compile with native cpu support and the given features. Look at [The cargo config in this repository](.cargo/config) to get an example. |
| 18 | +To be able to take advantage of simdjson your system needs to be SIMD compatible. This means to compile with native cpu support and the given features. Look at [The cargo config in this repository](.cargo/config) to get an example. |
19 | 19 |
|
20 | 20 | ### jemalloc
|
21 | 21 |
|
22 |
| -If you are writing performance centric code, make sure to use jemalloc and not the system allocator (that has now become default in rust), it gives an very noticable boost in performance. |
| 22 | +If you are writing performance centric code, make sure to use jemalloc and not the system allocator (which has now become default in rust), it gives a very noticeable boost in performance. |
23 | 23 |
|
24 | 24 | ## serde
|
25 | 25 |
|
26 |
| -simd-json.rs is compatible with serde and serde-json. The Value types provided implement serializers and deserialisers. In addition to that simd-json.rs implements the Deserializer for the parser so it can deserialize anything that implements the serde Deserialize trait. |
| 26 | +simdjson-rs is compatible with serde and serde-json. The Value types provided implement serializers and deserializers. In addition to that simdjson-rs implements the Deserializer for the parser so it can deserialize anything that implements the serde Deserialize trait. |
27 | 27 |
|
28 | 28 | That said serde is contained in the `serde_impl` feature which is part of the default feature set, but it can be disabled.
|
29 | 29 |
|
30 | 30 | ### serializing
|
31 | 31 |
|
32 |
| -sims-json.rs does not provide capabiltiy to serialize JSON data, serde-json does a good job at this and there would be very little won by re-implementing it. |
| 32 | +simdjson-rs is not capable of serializing JSON data as there would be very little gain by re-implementing it. For serialization, we recommend serde-json. |
| 33 | + |
33 | 34 |
|
34 | 35 | ### unsafe
|
35 | 36 |
|
36 |
| -simd-json.rs uses **a lot** of unsafe code first of all since all SIMD-intrinsics are inherently unsafe and also to work around some bottlenecks safe rust code. So this requires extra scrutiny and do to this diligently testing takes 5 shapes: |
| 37 | +simdjson-rs uses **a lot** of unsafe code first of all since all SIMD-intrinsics are inherently unsafe and also to work around some bottlenecks introduced by rust's safe nature. This requires extra scrutiny and thus needs to be diligently tested according to these 5 steps: |
37 | 38 |
|
38 | 39 | * Poor old unit tests - to test general 'obvious' cases and edge cases as well as regressions
|
39 |
| -* Property based testing on valid json - tests if valid but random generated json parses the same in simd-json and in serde-json (floats here are excloded since slighty different parsing algorihtms lead to slighty different results) |
40 |
| -* Property based testing on random 'human readable' data - make sure that randomly generated sequences of pritnable characters don't panic or crash the parser (they might and often error so - they are not valid json!) |
| 40 | +* Property based testing on valid json - tests if valid but random generated json parses the same in simd-json and in serde-json (floats here are excluded since slighty different parsing algorihtms lead to slighty different results) |
| 41 | +* Property based testing on random 'human readable' data - make sure that randomly generated sequences of printable characters don't panic or crash the parser (they might and often error so - they are not valid json!) |
41 | 42 | * Property based testing on random byte sequences - make sure that no random set of bytes will crash the parser
|
42 | 43 | * Fuzzing (using afl) - fuzz based on upstream simd pass/fail cases
|
43 | 44 |
|
44 |
| -This sure doesn't ensure complete safetly but it does go a long way. |
| 45 | +This certainly doesn't ensure complete safety but it does go a long way. |
45 | 46 |
|
46 | 47 | ## Other interesting things
|
47 | 48 |
|
|
0 commit comments