Readme
This commit is contained in:
53
README.md
Normal file
53
README.md
Normal file
@ -0,0 +1,53 @@
|
||||
# Pydantic vs MsgSpec
|
||||
|
||||
Libs used for benchmark:
|
||||
|
||||
- [pydantic 2.4.2](https://docs.pydantic.dev/latest/)
|
||||
- [msgspec 0.18.4](https://jcristharif.com/msgspec/index.html)
|
||||
|
||||
## Usage
|
||||
|
||||
### Install virtual environment
|
||||
|
||||
```
|
||||
poetry install
|
||||
```
|
||||
|
||||
### Create test data
|
||||
|
||||
- Edit `benchmark/factories.py` and set `COLUMNS_COUNT` and `PLANOGRAMS_COUNT` to desired size.
|
||||
- Uncomment `create_test_file(TEST_DATA_FILE)` line in main.py
|
||||
- Run main.py
|
||||
|
||||
You can comment back this line after json test file is created.
|
||||
|
||||
### Run benchmark
|
||||
|
||||
```
|
||||
python main.py
|
||||
```
|
||||
|
||||
## Results
|
||||
|
||||
```
|
||||
*** Running PydanticBenchmark
|
||||
Finished in 10.781s
|
||||
*** Running MsgSpecBenchmark
|
||||
Finished in 1.725s
|
||||
```
|
||||
|
||||
```
|
||||
██████╗ ██╗ ██╗██████╗ █████╗ ███╗ ██╗████████╗██╗ ██████╗
|
||||
██╔══██╗╚██╗ ██╔╝██╔══██╗██╔══██╗████╗ ██║╚══██╔══╝██║██╔════╝
|
||||
██████╔╝ ╚████╔╝ ██║ ██║███████║██╔██╗ ██║ ██║ ██║██║
|
||||
██╔═══╝ ╚██╔╝ ██║ ██║██╔══██║██║╚██╗██║ ██║ ██║██║
|
||||
██║ ██║ ██████╔╝██║ ██║██║ ╚████║ ██║ ██║╚██████╗
|
||||
╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═════╝
|
||||
|
||||
██╗ ██╗ ██████╗ ██╗ ██╗ ███████╗██╗ ██╗ ██████╗██╗ ██╗ ██████╗ █████╗ ██╗ ██╗ ███████╗
|
||||
╚██╗ ██╔╝██╔═══██╗██║ ██║ ██╔════╝██║ ██║██╔════╝██║ ██╔╝ ██╔══██╗██╔══██╗██║ ██║ ██╔════╝
|
||||
╚████╔╝ ██║ ██║██║ ██║ ███████╗██║ ██║██║ █████╔╝ ██████╔╝███████║██║ ██║ ███████╗
|
||||
╚██╔╝ ██║ ██║██║ ██║ ╚════██║██║ ██║██║ ██╔═██╗ ██╔══██╗██╔══██║██║ ██║ ╚════██║
|
||||
██║ ╚██████╔╝╚██████╔╝ ███████║╚██████╔╝╚██████╗██║ ██╗ ██████╔╝██║ ██║███████╗███████╗███████║
|
||||
╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝
|
||||
```
|
||||
Reference in New Issue
Block a user