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

Streaming file content #46

Open
caffeine-addictt opened this issue May 2, 2024 · 0 comments
Open

Streaming file content #46

caffeine-addictt opened this issue May 2, 2024 · 0 comments
Assignees
Labels
help wanted Help wanted Type: Enhancement Suggest an improvement for an existing feature.

Comments

@caffeine-addictt
Copy link
Owner

Enhancement Request

Your issue may already be reported!
Please check out our active issues before creating one.

Is Your Enhancement Request Related to an Issue?

At present, we load all file contents into memory and do a singular RegExp match and replace operation.
Doing it this way is not optimal (not too impactful, but we strive to ship good software c;);

  • Will require more memory
  • Will impact runtime performance

Describe the Solution You'd Like

File streaming.

Instead of loading the file contents into memory, we can just;

  1. stream each line of the file into memory
  2. format the line with the same RegExp
  3. stream the formatted line into a generated file in a generated temp directory
  4. then replace the original file with the formatted file

Note

I have already tried to implement this, albeit unsuccessfully.
You can find my unsuccessful code highlighted here.

Additional Context

PRs welcome!

@caffeine-addictt caffeine-addictt added help wanted Help wanted Type: Enhancement Suggest an improvement for an existing feature. labels May 2, 2024
@caffeine-addictt caffeine-addictt self-assigned this May 2, 2024
@caffeine-addictt caffeine-addictt pinned this issue May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Help wanted Type: Enhancement Suggest an improvement for an existing feature.
Projects
None yet
Development

No branches or pull requests

1 participant