v3(enhancement): remove utils.Trim* because stdlib has same performance in go1.19#2030
Merged
trim21 merged 17 commits intogofiber:v3-betafrom Aug 20, 2022
Merged
v3(enhancement): remove utils.Trim* because stdlib has same performance in go1.19#2030trim21 merged 17 commits intogofiber:v3-betafrom
utils.Trim* because stdlib has same performance in go1.19#2030trim21 merged 17 commits intogofiber:v3-betafrom
Conversation
Member
|
can you check my last comments from the old one ? |
utils.EqualFold
Contributor
Author
|
do you considering using https://github.com/stretchr/testify instead of current |
Contributor
Author
done |
Contributor
Author
|
I just keep the old tests and benchmark as bytes inputs |
trim21
commented
Aug 19, 2022
| // indicating that the request was issued by a client library (such as jQuery). | ||
| func (c *DefaultCtx) XHR() bool { | ||
| return utils.EqualFoldBytes(utils.UnsafeBytes(c.Get(HeaderXRequestedWith)), []byte("xmlhttprequest")) | ||
| return utils.EqualFold(c.Get(HeaderXRequestedWith), "xmlhttprequest") |
Contributor
Author
There was a problem hiding this comment.
why do we use EqualFoldBytes instead of EqualFold in the first place?
Contributor
Author
|
I saw the updated benchmark result, I think we can remove these go 1.19 1.18 , our version is a little bit faster. |
Member
I agree |
utils.Trim* because stdlib has save performance now
utils.Trim* because stdlib has save performance nowutils.Trim* because stdlib has same performance now
utils.Trim* because stdlib has same performance nowutils.Trim* because stdlib has same performance in go1.19
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pr remove
Trim,TrimRightandTrimLeft.Stdlib functions have save performance now.