This repository was archived by the owner on Jun 2, 2025. It is now read-only.
perf(WAS_Load_Image_Batch): Optimize file list caching for large dire… #591
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses a performance issue where WAS_Load_Image_Batch was slow when dealing with directories containing a very large number of files, even after initial file listing cache was implemented. The bottleneck was identified as the cost of loading/deserializing a massive file path list from the database cache.
This commit refactors the caching mechanism within
BatchImageLoader:Batch Images Paths Cache Textcategory), which is generally more efficient for storing and retrieving large lists of strings.IS_CHANGEDmethod to correctly utilize the cached file paths based on the input index for 'single_image' mode.Additionally, the call to
update_history_images(new_paths)inload_batch_imageshas been commented out as it was suspected to be a significant bottleneck when processing the entire list of potentially millions of file paths on every node execution. If history tracking is required,update_history_imagesmay need to be optimized to handle large lists efficiently or process only the single loaded file.These changes aim to drastically reduce the time spent loading the file list cache, improving responsiveness when working with extensive image libraries.