refactor(@angular/build): implement generic persistent load result cache infrastructure for build pipeline#33651
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a persistent load result cache (PersistentLoadResultCache) for esbuild and a global stylesheet configuration hashing utility, along with their respective unit tests. The review feedback focuses on performance improvements, specifically recommending the replacement of synchronous file I/O operations with non-blocking asynchronous alternatives (fsPromises.readFile) processed in parallel. Additionally, it suggests using incremental hash updates to prevent inefficient implicit string coercion of binary buffers.
78e50e5 to
edabae0
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a persistent caching mechanism for esbuild load results, including the PersistentLoadResultCache class and a utility to calculate global stylesheet configuration hashes. Feedback focuses on optimizing performance and avoiding event loop blocking by replacing synchronous fs.existsSync calls with asynchronous error handling during file reads. Additionally, it is recommended to use file metadata (size and modification time) instead of reading full file contents to compute cache keys, and to address potential non-deterministic serialization issues when hashing complex stylesheet options.
edabae0 to
4c6e41c
Compare
…che infrastructure for build pipeline This change implements a unified, generic persistent caching system for the esbuild builder pipeline. It introduces a two-tier caching mechanism combining in-memory caching with a persistent disk store. Integration into various aspects of the build system will be performed in future changes.
4c6e41c to
6b0bc31
Compare
This change implements a unified, generic persistent caching system for the esbuild builder pipeline. It introduces a two-tier caching mechanism combining in-memory caching with a persistent disk store. Integration into various aspects of the build system will be performed in future changes.