-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Discourage inlining the resize case, as that should happen rather rar…
…ely. If you additionally reuse buffers, this will increase the performance further. The metrics based on some internal benchmarks show a speedup of about 1%: bitsery <dont inline bad cases> BigString: 222092ns ComplexLittleObjects: 34115ns ComplexLittleObjectsBig: 6222801ns bitsery <original> BigString: 242853ns ComplexLittleObjects: 35738ns ComplexLittleObjectsBig: 6334747ns The assembly has been checked to be correct: https://godbolt.org/z/Wr7qvfGrK Additionally, when allocating code, we can tell the compiler that we are not resizing to a lower size, this saves on gcc 14 a few instructions. The improvement should be negligible.
- Loading branch information
1 parent
cd73aca
commit be2f295
Showing
3 changed files
with
82 additions
and
10 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