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

feat: Limit route info events to 3 recent entries #164

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ttizze
Copy link

@ttizze ttizze commented Nov 16, 2024

Description

Issue

During extended development sessions, route information continuously accumulates in memory as new loader/action events are processed. This leads to:

  • Increasing memory consumption
  • Potential performance degradation
  • Unnecessary storage of old event data

Changes

  • Added a limit to store only the 3 most recent events for each route's loaders and actions
  • Applied slice(-3) to both loader and action event arrays

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Unit tests

Checklist:

  • My code follows the guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@ttizze ttizze changed the title fix-cb2 refactor: Optimize route info event processing with recent history limit Nov 16, 2024
@ttizze ttizze marked this pull request as draft November 16, 2024 07:08
@ttizze ttizze changed the title refactor: Optimize route info event processing with recent history limit feat: Limit route info events to 3 recent entries Nov 16, 2024
@ttizze ttizze marked this pull request as ready for review November 16, 2024 07:13
@AlemTuzlak
Copy link
Contributor

Interesting, I wonder if this could be a config option on how many you want to save instead of deciding for the user, eg you can set it to 3,5, 30

@ttizze
Copy link
Author

ttizze commented Nov 20, 2024

I'm not sure about all the details, but how about something like this?

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