-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unsafe little endian loaders (#1036)
Benchmarks without assembly (may be a bit noisy) deflate: ``` BEFORE: github-june-2days-2019.json gzkp 1 6273951764 1073607045 17441 343.04 github-june-2days-2019.json gzkp 2 6273951764 1045461954 24258 246.65 github-june-2days-2019.json gzkp 3 6273951764 1030139729 21752 275.06 github-june-2days-2019.json gzkp 4 6273951764 992526317 25868 231.29 github-june-2days-2019.json gzkp 5 6273951764 938015731 28992 206.38 github-june-2days-2019.json gzkp 6 6273951764 918717756 32863 182.07 github-june-2days-2019.json gzkp 7 6273951764 924473679 42332 141.34 github-june-2days-2019.json gzkp 8 6273951764 905294390 53014 112.86 github-june-2days-2019.json gzkp 9 6273951764 895561157 100686 59.43 github-june-2days-2019.json gzkp -2 6273951764 4097019597 12499 478.70 github-june-2days-2019.json gzkp -3 6273951764 1175153215 24140 247.85 AFTER: github-june-2days-2019.json gzkp 1 6273951764 1073607045 16584 360.79 github-june-2days-2019.json gzkp 2 6273951764 1045461954 19113 313.04 github-june-2days-2019.json gzkp 3 6273951764 1030139729 20420 293.00 github-june-2days-2019.json gzkp 4 6273951764 992526317 23619 253.32 github-june-2days-2019.json gzkp 5 6273951764 938015731 26842 222.90 github-june-2days-2019.json gzkp 6 6273951764 918717756 30541 195.90 github-june-2days-2019.json gzkp 7 6273951764 924473679 43810 136.57 github-june-2days-2019.json gzkp 8 6273951764 905294390 73933 80.93 github-june-2days-2019.json gzkp 9 6273951764 895561157 98379 60.82 github-june-2days-2019.json gzkp -2 6273951764 4097019597 13439 445.20 github-june-2days-2019.json gzkp -3 6273951764 1175153215 22819 262.20 ``` zstd: ``` github-june-2days-2019.json zskp 1 6273951764 697439481 9378 637.96 github-june-2days-2019.json zskp 2 6273951764 610876538 12416 481.87 github-june-2days-2019.json zskp 3 6273951764 545382443 40775 146.74 github-june-2days-2019.json zskp 4 6273951764 522934301 114291 52.35 github-june-2days-2019.json zskp 1 6273951764 697439481 8325 718.69 github-june-2days-2019.json zskp 2 6273951764 610876538 9905 604.04 github-june-2days-2019.json zskp 3 6273951764 545382443 29954 199.74 github-june-2days-2019.json zskp 4 6273951764 522934301 111174 53.82 ``` s2: ``` github-june-2days-2019.json s2 1 6273951764 1041705230 522 11443.55 github-june-2days-2019.json s2 2 6273951764 944873043 1248 4793.24 github-june-2days-2019.json s2 3 6273951764 826384742 9999 598.37 github-june-2days-2019.json s2 1 6273951764 1041705230 464 12868.90 github-june-2days-2019.json s2 2 6273951764 944873043 861 6947.69 github-june-2days-2019.json s2 3 6273951764 826384742 9335 640.94 ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new `le` package for flexible integer type handling. - Added new functions for loading and storing binary data in little-endian format. - Enhanced test coverage with `nounsafe` build tag in GitHub Actions workflow. - **Refactor** - Updated byte loading mechanisms across multiple packages. - Replaced `encoding/binary` imports with custom `internal/le` package. - Modified bit reader and decoder offset handling. - Adjusted decoding logic to utilize cursor for state management. - Removed outdated comments regarding bounds checks in code. - **Chores** - Updated build constraints and import statements. - Refined error handling in decoding processes. - Adjusted assembly code offsets for improved performance. - Updated Go version from 1.19 to 1.21 in module file. - **Tests** - Simplified error reporting in decompression tests. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
Showing
26 changed files
with
276 additions
and
193 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
//go:build go1.18 | ||
// +build go1.18 | ||
|
||
package flate | ||
|
||
|
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
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
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.