Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved memoization logic #44

Closed
lars-reimann opened this issue Feb 1, 2024 · 1 comment · Fixed by #81
Closed

Improved memoization logic #44

lars-reimann opened this issue Feb 1, 2024 · 1 comment · Fixed by #81
Assignees
Labels
enhancement 💡 New feature or request released Included in a release

Comments

@lars-reimann
Copy link
Member

lars-reimann commented Feb 1, 2024

Is your feature request related to a problem?

It makes no sense to cache large values that are fast to compute. Likewise, once we need to clear memoized values to free space, we need to decide which values to remove.

Desired solution

When memoizing, also track

  • last access,
  • time to compute value,
  • time to perform lookup in memoization table (equality check can also be expensive),
  • size of value.

Then evaluate different strategies for

  • deciding which values to memoize at all,
  • which values to remove to free space.

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

No response

@lars-reimann lars-reimann added the enhancement 💡 New feature or request label Feb 1, 2024
WinPlay02 added a commit to WinPlay02/Library that referenced this issue Feb 5, 2024
This is needed to correctly evaluate whether an object is worth memoizing or keeping in the cache.

See for context: Safe-DS/Runner#51 and Safe-DS/Runner#44
lars-reimann pushed a commit to Safe-DS/Library that referenced this issue Feb 5, 2024
Summary:
- feat: return the correct size for custom container objects

This is needed to correctly evaluate whether an object is worth
memoizing or keeping in the cache.

See for context: Safe-DS/Runner#51 and
Safe-DS/Runner#44

For future container classes (like e.g. image set this would also need
to be added, to be compatible with the memoizing implementation in the
runner)
lars-reimann added a commit that referenced this issue Feb 6, 2024
Closes partially #44

### Summary of Changes

- track more stats: last access, computation time, last access time,
memory usage
- refactored memoization logic into a new class
- updated to safe-ds library 0.19

---------

Co-authored-by: megalinter-bot <129584137+megalinter-bot@users.noreply.github.com>
Co-authored-by: Lars Reimann <mail@larsreimann.com>
lars-reimann pushed a commit that referenced this issue Feb 8, 2024
## [0.6.0](v0.5.0...v0.6.0) (2024-02-08)

### Features

* track memoization stats ([#51](#51)) ([50f30a3](50f30a3)), closes [#44](#44)
lars-reimann pushed a commit that referenced this issue Apr 16, 2024
### Summary of Changes

- shared memory
- lazy comparisons
- limited memory 
- value removal strategies
- use deterministic seed for hashing

Closes #44

Depends on Safe-DS/Library#609

---------

Co-authored-by: megalinter-bot <129584137+megalinter-bot@users.noreply.github.com>
lars-reimann pushed a commit that referenced this issue Apr 17, 2024
## [0.11.0](v0.10.0...v0.11.0) (2024-04-17)

### Features

* bump `safe-ds` to `v0.21.0` ([#86](#86)) ([d780822](d780822)), closes [#85](#85)
* memoization improvements ([#81](#81)) ([6bc2288](6bc2288)), closes [#44](#44)
@lars-reimann
Copy link
Member Author

🎉 This issue has been resolved in version 0.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lars-reimann lars-reimann added the released Included in a release label Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 💡 New feature or request released Included in a release
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants