Skip to content

feat(memory-cache): add maxGenerations support#9517

Merged
h-a-n-a merged 1 commit intomainfrom
max-generation
Feb 28, 2025
Merged

feat(memory-cache): add maxGenerations support#9517
h-a-n-a merged 1 commit intomainfrom
max-generation

Conversation

@h-a-n-a
Copy link
Contributor

@h-a-n-a h-a-n-a commented Feb 28, 2025

Summary

Close #9405

Added maxGenerations support for memory cache. By default, maxGenerations is set to 1.

The option is used to define how many cycles memory cache will survive if it's not being accessed to in future generations:
With max_generations set to x, the cache was generated on generation y, will be removed on generation x + y + 1.

For example: Cache created on generation 0 will be removed on generation 2 with max_generations set to 1, if it's not accessed on generation 1.

This option is not being exposed to users for now, as the cache key is encoded with hash, resulting it's not likely to be reused between compilations if it's source was changed.

Lifting memory consumption in #8976 (comment)

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@github-actions github-actions bot added release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack. labels Feb 28, 2025
@netlify
Copy link

netlify bot commented Feb 28, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit f6105a3
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/67c19102934df70008686418
😎 Deploy Preview https://deploy-preview-9517--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 28, 2025

CodSpeed Performance Report

Merging #9517 will not alter performance

Comparing max-generation (f6105a3) with main (a2a1f74)

Summary

✅ 7 untouched benchmarks

@h-a-n-a h-a-n-a marked this pull request as ready for review February 28, 2025 11:06
@h-a-n-a h-a-n-a merged commit 25661fe into main Feb 28, 2025
39 checks passed
@h-a-n-a h-a-n-a deleted the max-generation branch February 28, 2025 11:09
@h-a-n-a
Copy link
Contributor Author

h-a-n-a commented Feb 28, 2025

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

Labels

release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Support maxGeneartion for cache

2 participants