Skip to content

Commit

Permalink
0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ita9naiwa committed Mar 1, 2023
1 parent af80d21 commit a201add
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,20 @@ functions
```

### load example

`load` take either string or file object. If string is given, it is assumed that it's a path to json file


```python
>>> import pyyjson
>>> pyyjson.load("simple_json.json") # in "tests/" directory
{'a': 1, 'b': 2, 'c': 3}
```

### dump example

`dump` take either string or file object. If string is given, it is assumed that it's a path to save the file

```python
>>> import pyyjson
>>> pyyjson.dump({'a': 1, 'b': 2, 'c': 3}, "simple_json.json")
Expand All @@ -49,11 +56,11 @@ each elements in cols denotes "calls/sec". Test suite is adapted from ujson's be

| content | | json | ujson | orjson | pyyjson(mine) |
|:-----------------------:|:------:|:-----:|:-----:|:------:|:-------------:|
| Arr of 256 doubles | ENCODE | 10119 | 35361 | 170829 |124386 |
| Arr of 256 dobules | DECODE | 28684 | 54593 | 170383 | 122328 |
| Arr of 256 UTF-8 string | ENCODE | 5247 | 7344 | 45684 | 8797 |
| Arr of 256 UTF-8 String | DECODE | 2838 | 5223 | 7248 | 5516 |
| Arr of 256 strings | ENCODE | 36624 | 59568 | 216707 | 136944 |
| Arr of 256 strings | DECODE | 66842 | 66960 | 100252 | 105645 |
| Medium complex object | ENCODE | 9948 | 22344 | 80465 | 56106 |
| Medium complex object | DECODE | 17183 | 28733 | 45008 | 26377 |
| Arr of 256 doubles | ENCODE | 10119 | 35361 | 170829 |44925 |
| Arr of 256 dobules | DECODE | 28684 | 54593 | 170383 | 155127 |
| Arr of 256 UTF-8 string | ENCODE | 5247 | 7344 | 45684 | 8554 |
| Arr of 256 UTF-8 String | DECODE | 2838 | 5223 | 7248 | 6424 |
| Arr of 256 strings | ENCODE | 36624 | 59568 | 216707 | 87624 |
| Arr of 256 strings | DECODE | 66842 | 66960 | 100252 | 98242 |
| Medium complex object | ENCODE | 9948 | 22344 | 80465 | 30888 |
| Medium complex object | DECODE | 17183 | 28733 | 45008 | 29267 |

0 comments on commit a201add

Please sign in to comment.