[PR #3833] [MERGED] 3416 file picker load times #4430

Closed
opened 2026-02-22 18:35:49 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/3833
Author: @timothycarambat
Created: 5/15/2025
Status: Merged
Merged: 5/15/2025
Merged by: @timothycarambat

Base: masterHead: 3416-file-picker-load-times


📝 Commits (3)

📊 Changes

1 file changed (+109 additions, -16 deletions)

View changed files

📝 server/utils/files/index.js (+109 -16)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

closes #3497
closes https://github.com/Mintplex-Labs/anything-llm/pull/3416
connect #3135

What is in this change?

  • Implements a conditional readStreaming for rendering of the local file picker.
  • The current file size limit is 150mb, as most files are less than this value.
  • Most users will not notice a delay or change in the load times since this path is unlikely to be hit often.
  • Will run concurrent IO for streaming files while also pruning the pageContent to reduce memory overhead.
  • While streaming a file does take longer if hit, it is more optimized now to not load the whole file into memory at once and the page content will be dumped at the end.

Additional Information

  • we did try a streaming JSON parser, however this impacted the performance even worse (+400% time) and that tradeoff is simply not worth it at this time.
  • The inclusion of lazy loading folders will allow us to raise the threshold and then we get the best of both.

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/3833 **Author:** [@timothycarambat](https://github.com/timothycarambat) **Created:** 5/15/2025 **Status:** ✅ Merged **Merged:** 5/15/2025 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `3416-file-picker-load-times` --- ### 📝 Commits (3) - [`f2ab353`](https://github.com/Mintplex-Labs/anything-llm/commit/f2ab35357b85679103366f1fcf37929e1ad4dccd) wip - [`476180b`](https://github.com/Mintplex-Labs/anything-llm/commit/476180b9afc2a3f1e7dcb0ab353442871d8522a4) implment conditional streaming - [`f2a8867`](https://github.com/Mintplex-Labs/anything-llm/commit/f2a8867abc3cf4376391c6d738e1b4fcef7a409b) no bench ### 📊 Changes **1 file changed** (+109 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `server/utils/files/index.js` (+109 -16) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [ ] ✨ feat - [ ] 🐛 fix - [x] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> closes #3497 closes https://github.com/Mintplex-Labs/anything-llm/pull/3416 connect #3135 ### What is in this change? - Implements a conditional readStreaming for rendering of the local file picker. - The current file size limit is 150mb, as most files are less than this value. - Most users will not notice a delay or change in the load times since this path is unlikely to be hit often. - Will run concurrent IO for streaming files while also pruning the `pageContent` to reduce memory overhead. - While streaming a file does take longer if hit, it is more optimized now to not load the whole file into memory at once and the page content will be dumped at the end. ### Additional Information - we did try a streaming JSON parser, however this impacted the performance even worse (+400% time) and that tradeoff is simply not worth it at this time. - The inclusion of lazy loading folders will allow us to raise the threshold and then we get the best of both. ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [x] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:35:49 -05:00
yindo closed this issue 2026-02-22 18:35:49 -05:00
yindo changed title from [PR #3833] 3416 file picker load times to [PR #3833] [MERGED] 3416 file picker load times 2026-06-05 15:18:30 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4430