|
1 | 1 | # @jsonjoy.com/codegen |
2 | 2 |
|
3 | | -This package contains utilities for generating optimized JavaScript code at runtime. |
4 | | -It enables creating high-performance functions by generating code dynamically based |
| 3 | +This package contains utilities for generating optimized JavaScript code at runtime. |
| 4 | +It enables creating high-performance functions by generating code dynamically based |
5 | 5 | on schemas, templates, or runtime data. |
6 | 6 |
|
7 | 7 | ## Key Benefits |
8 | 8 |
|
9 | | -JIT (Just-In-Time) code generation can provide significant performance improvements |
| 9 | +JIT (Just-In-Time) code generation can provide significant performance improvements |
10 | 10 | when you have advance knowledge of the data structure or execution pattern. |
11 | 11 |
|
12 | 12 | Some examples: |
13 | 13 |
|
14 | 14 | - **Deep equality comparison function**: When one object is known in advance, we can |
15 | 15 | generate an optimized function that efficiently compares against a single object. |
16 | 16 | This technique is implemented in the `json-equal` library. |
17 | | - |
18 | | -- **JSON Patch execution**: When the JSON Patch operations are known beforehand, we can |
| 17 | + |
| 18 | +- **JSON Patch execution**: When the JSON Patch operations are known beforehand, we can |
19 | 19 | generate an optimized function that applies the patch in the most efficient way. |
20 | 20 | This approach is used in the `json-patch` library. |
21 | | - |
22 | | -- **Schema-based validation**: Given a `json-type` schema of a JSON object, it's possible |
23 | | - to generate highly optimized functions for validation and serialization that avoid |
| 21 | + |
| 22 | +- **Schema-based validation**: Given a `json-type` schema of a JSON object, it's possible |
| 23 | + to generate highly optimized functions for validation and serialization that avoid |
24 | 24 | generic overhead and execute significantly faster than traditional approaches. |
0 commit comments