Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jacobwilliams/json-fortran-benchmarks
Benchmarks for JSON Fortran parsers
https://github.com/jacobwilliams/json-fortran-benchmarks
fortran json
Last synced: about 6 hours ago
JSON representation
Benchmarks for JSON Fortran parsers
- Host: GitHub
- URL: https://github.com/jacobwilliams/json-fortran-benchmarks
- Owner: jacobwilliams
- License: bsd-3-clause
- Created: 2021-10-30T03:17:26.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-08-02T15:12:25.000Z (over 2 years ago)
- Last Synced: 2024-01-29T08:46:06.680Z (9 months ago)
- Topics: fortran, json
- Language: Fortran
- Homepage:
- Size: 604 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# json-fortran-benchmarks
Benchmarks for JSON Fortran parsers. Also comparison to Python.## To compile
```
fpm build --profile release
```## To run tests
```
fpm run read_file_test
fpm run fson_test
fpm run tomlf_test
fpm run rojff_test
fpm run json_fortran_testpython json_test.py
python ujson_test.py
python rapidjson_test.py
```## Sample results:
The benchmarks were run on an M1 MacBook Pro.
To parse the `canada.json` file:
First, just the time to read the entire file into a `character(len=:),allocatable` string:
```
read file to a string : 0.0004 seconds
```### Fortran libs
```
json_fortran : 0.1162 seconds
tomlf : 0.1352 seconds
rojff : 0.2367 seconds
fson : 0.8735 seconds
```### Python libs
```
json : 0.022102208 seconds
ujson : 0.011403209 seconds
rapidjson : 0.032243625 seconds
```## See also
* [JSON](https://degenerateconic.com/json.html) [degenerateconic.com]