Repository navigation
perf: limit open files in generateFSTree - #2145
marvin-j97 wants to merge 1 commit into
Conversation
|
Thanks for this PR. Quickly looking it seems nice changes. I might delay it to next releases to test better. |
|
While the fix here mainly concerns memory exhaustion caused by too many open promises at once, I propose some further optimizations to additionally work around possible performance issues caused by processing larger files. It seems unnecessary to read entire files into memory just to calculate gzip size on them. Obtaining the uncompressed file size could be done through Also Node v19.4.0, v18.14.0 introduced |
|
@marvin-j97 Did you close this PR by removing your repo deliberately 😅? @pi0 should we create a new one 🤔? |
|
Damnit I think I did. I cleaned up my repos because I have way too many and GitHub doesn't show you you have open PRs 💀 |
|
@marvin-j97 Ohh I see 🙈, unlucky 😅! Do you wanna create a new PR or would you prefer if someone else would take care of this? |
|
🔗 Linked issue
#1833
❓ Type of change
📚 Description
generateFSTree opens up to N files at the same time. Operating systems limit the amount of open files per process (linux defaults to 1024). Also, awaiting many Promises adds overhead, especially when a function is CPU-bound (gzipping for example). Collecting files has been extracted into
collectFiles, which uses globby & tiny-async-pool to process 8 (subject to change) files at a time.Should limit the amount of open files to fix #1833
📝 Checklist