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(shared-ini-file-loader): refactor loadSharedConfigFiles into modular components #3285

Merged
merged 14 commits into from
Feb 10, 2022

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Feb 7, 2022

Issue

Fixes: #3019
Refs: #3279

Description

  • Refactors loadSharedConfigFiles to break it into individual components.
  • Caches contents of readFile for a path, and ensures that it's called only once in parallel calls.

Testing

  • Unit testing
  • yarn test:integration
  • yarn test:integration:legacy
Single client

Refs: #3019 (comment)

  • Before: 4 calls to readFile
  • After: 2 calls to readFile
Two clients

Refs: #3019 (comment)

  • Before: 8 calls to readFile
  • After: 2 calls to readFile
Client with an operation

Refs: #3019 (comment)

  • Before: 16 calls to readFile
  • After: 2 calls to readFile

Additional Context

This is the merge of prior attempts in:


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@trivikr

This comment was marked as outdated.

@trivikr trivikr changed the title feat(shared-ini-file-loader): refactor loadSharedConfigFiles feat(shared-ini-file-loader): refactor loadSharedConfigFiles into modular components Feb 7, 2022
@trivikr trivikr marked this pull request as draft February 7, 2022 22:32
@trivikr trivikr force-pushed the refactor-shared-ini-file-loader branch from 19b27b7 to 5ccdc1e Compare February 9, 2022 21:27
@trivikr

This comment was marked as outdated.

@trivikr

This comment was marked as outdated.

Copy link
Contributor

@AllanZhengYP AllanZhengYP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you for taking care of it!

@trivikr
Copy link
Member Author

trivikr commented Feb 10, 2022

npm pack size comparison:

Before: 7.4 kB
$ yarn clean && rm -rf *.tsbuildinfo && yarn build

$ npm pack
...
npm notice package size:  7.4 kB                                    
npm notice unpacked size: 23.4 kB
...
After: 8.5 kB
$ yarn clean && rm -rf *.tsbuildinfo && yarn build

$ npm pack
...
npm notice package size:  8.5 kB                                    
npm notice unpacked size: 27.8 kB
...

@trivikr trivikr force-pushed the refactor-shared-ini-file-loader branch from e815f32 to bd2c825 Compare February 10, 2022 22:39
@trivikr trivikr merged commit 2613f66 into aws:main Feb 10, 2022
@trivikr trivikr deleted the refactor-shared-ini-file-loader branch February 10, 2022 23:04
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clients read config from file resulting in EMFILE (too many open files) errors
3 participants