Skip to content

fix(minigame): refactor LRU cache cleanup in cache-manager#171

Open
qiuguohua wants to merge 2 commits into
cocos:v4.0.0from
qiuguohua:v4.0.0_fix_cache
Open

fix(minigame): refactor LRU cache cleanup in cache-manager#171
qiuguohua wants to merge 2 commits into
cocos:v4.0.0from
qiuguohua:v4.0.0_fix_cache

Conversation

@qiuguohua

Copy link
Copy Markdown
Contributor
  • Change cache eviction ratio from 1/3 to 1/2
  • Extract _deleteLRUCaches() for concurrent deletion with callbacks
  • Add onComplete callback to _removePathOrFile for deletion tracking
  • Add LOG_PREFIX logging for init and LRU deletion lifecycle

Re: #

Changelog


Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

- Change cache eviction ratio from 1/3 to 1/2
- Extract _deleteLRUCaches() for concurrent deletion with callbacks
- Add onComplete callback to _removePathOrFile for deletion tracking
- Add LOG_PREFIX logging for init and LRU deletion lifecycle
@qiuguohua

Copy link
Copy Markdown
Contributor Author

#165

@github-actions

Copy link
Copy Markdown

Code Size Check Report

Wechat (WASM) Before After Diff
2D Empty (legacy pipeline) 1014459 bytes 1014459 bytes ✅ 0 bytes
2D All (legacy pipeline) 2681984 bytes 2681984 bytes ✅ 0 bytes
2D All (new pipeline) 2773761 bytes 2773761 bytes ✅ 0 bytes
(2D + 3D) All 10030977 bytes 10030977 bytes ✅ 0 bytes
Web (WASM + ASMJS) Before After Diff
(2D + 3D) All 16867390 bytes 16867390 bytes ✅ 0 bytes

Interface Check Report

This pull request does not change any public interfaces !

console.warn(`${LOG_PREFIX} init storage`, {
cacheDir: this.cacheDir,
cacheFilePath,
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we change warn to debug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants