Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ini2 parser #2365

Merged
merged 6 commits into from
Nov 13, 2023
Merged

feat: ini2 parser #2365

merged 6 commits into from
Nov 13, 2023

Conversation

lucix-aws
Copy link
Contributor

@lucix-aws lucix-aws commented Nov 10, 2023

Replace the legacy, undocumented, and unmaintainable shared config parser with a vastly simplified implementation.

Parse failures (unrecognized tokens) will now silently be ignored rather than dropping the entire profile, and the implementation is much more lenient in general.

I've included the benchmarks provided courtesy of @krousey in #2353 and we actually observe a performance boost from this reimplementation:

old:

goos: darwin
goarch: amd64
pkg: github.com/aws/aws-sdk-go-v2/config
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkLoadProfile1-12           15345             80243 ns/op
BenchmarkLoadProfile10-12           4615            244160 ns/op
BenchmarkLoadProfile100-12           673           1832922 ns/op
BenchmarkLoadProfile1000-12           69          16511466 ns/op
PASS
ok      github.com/aws/aws-sdk-go-v2/config     11.801s                               

new:

goos: darwin                                                    
goarch: amd64                                                   
pkg: github.com/aws/aws-sdk-go-v2/config                        
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz                   
BenchmarkLoadProfile1-12           17833             68068 ns/op
BenchmarkLoadProfile10-12           9366            117720 ns/op
BenchmarkLoadProfile100-12          1878            614622 ns/op
BenchmarkLoadProfile1000-12          219           5464137 ns/op
PASS                                                            
ok      github.com/aws/aws-sdk-go-v2/config     8.942s      

@lucix-aws lucix-aws requested a review from a team as a code owner November 10, 2023 16:57
@lucix-aws lucix-aws linked an issue Nov 10, 2023 that may be closed by this pull request
@lucix-aws lucix-aws marked this pull request as draft November 10, 2023 17:14
@lucix-aws lucix-aws self-assigned this Nov 10, 2023
@lucix-aws lucix-aws marked this pull request as ready for review November 10, 2023 17:45
@lucix-aws lucix-aws merged commit 5c1b48d into main Nov 13, 2023
11 of 12 checks passed
@lucix-aws lucix-aws deleted the ini2 branch November 13, 2023 17:29
ewbankkit added a commit to hashicorp/aws-sdk-go-base that referenced this pull request Nov 20, 2023
PhillipGameDev added a commit to PhillipGameDev/AWS-SDK-GO-BACKEND that referenced this pull request Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fixes to INI parsing incomplete
3 participants