3.1 KiB
3.1 KiB
Pydantic vs MsgSpec
Libs used for benchmark:
Usage
Install virtual environment
poetry install
Create test data
- Edit
benchmark/factories.pyand setCOLUMNS_COUNTandPLANOGRAMS_COUNTto 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
██████╗ ██╗ ██╗██████╗ █████╗ ███╗ ██╗████████╗██╗ ██████╗
██╔══██╗╚██╗ ██╔╝██╔══██╗██╔══██╗████╗ ██║╚══██╔══╝██║██╔════╝
██████╔╝ ╚████╔╝ ██║ ██║███████║██╔██╗ ██║ ██║ ██║██║
██╔═══╝ ╚██╔╝ ██║ ██║██╔══██║██║╚██╗██║ ██║ ██║██║
██║ ██║ ██████╔╝██║ ██║██║ ╚████║ ██║ ██║╚██████╗
╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═════╝
██╗ ██╗ ██████╗ ██╗ ██╗ ███████╗██╗ ██╗ ██████╗██╗ ██╗ ██████╗ █████╗ ██╗ ██╗ ███████╗
╚██╗ ██╔╝██╔═══██╗██║ ██║ ██╔════╝██║ ██║██╔════╝██║ ██╔╝ ██╔══██╗██╔══██╗██║ ██║ ██╔════╝
╚████╔╝ ██║ ██║██║ ██║ ███████╗██║ ██║██║ █████╔╝ ██████╔╝███████║██║ ██║ ███████╗
╚██╔╝ ██║ ██║██║ ██║ ╚════██║██║ ██║██║ ██╔═██╗ ██╔══██╗██╔══██║██║ ██║ ╚════██║
██║ ╚██████╔╝╚██████╔╝ ███████║╚██████╔╝╚██████╗██║ ██╗ ██████╔╝██║ ██║███████╗███████╗███████║
╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝