-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use binascii instead of plain python [INFRA-404] (#941)
+ strip out use of use of construct when deframing, this moves construct out of the deframing hot path + use binascii (which is a C extension module) to implement the CRC calculation: https://github.com/python/cpython/blob/master/Modules/binascii.c + Used sbp2json (skipping the `dispatch` method which parses into fields) to test the speed of just deframing. Speed of deframing (no JSON serializatoin) with master: ``` Benchmark #1: python -m sbp2json <test_data/benchmark.sbp Time (mean ± σ): 11.990 s ± 0.331 s [User: 11.979 s, System: 0.011 s] Range (min … max): 11.441 s … 12.556 s 10 runs ``` Speed of deframing (no JSON serialization) with this branch: ``` ❯ hyperfine 'python -m sbp2json --include 1 <test_data/benchmark.sbp' (libsbp) Benchmark #1: python -m sbp2json --include 1 <test_data/benchmark.sbp Time (mean ± σ): 961.3 ms ± 18.7 ms [User: 953.2 ms, System: 8.1 ms] Range (min … max): 927.6 ms … 979.2 ms 10 runs ```
- Loading branch information
Jason Mobarak
authored
Mar 30, 2021
1 parent
8dec368
commit 0622d1f
Showing
9 changed files
with
87 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.