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

Simplifying discardOldestFileIfNeeded function #2074

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

hannah-smartbear
Copy link
Contributor

Goal

The function had a fairly high overhead, making several copies of the list of files. The goal was to reduce this.

Changeset

  • Return earlier if the number of files is less than the maxStoreCount (previously this wasn't checked until a second copy of the list had already been made)
  • Sort the first file list by last modified timestamp, instead of copying into a list and then sorting

Testing

  • Tests already written for this function are still applicable
  • Tested this locally

@bugsnagbot
Copy link
Collaborator

bugsnagbot commented Sep 17, 2024

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1854.01 1674.7
arm64_v8a 631.04 450.82
armeabi_v7a 565.51 385.29
x86 708.85 528.62
x86_64 676.09 495.86

Generated by 🚫 Danger

@lemnik lemnik force-pushed the PLAT-11195/improve-discardoldestfileifneeded branch from 9bb4e01 to 3aabb9e Compare September 20, 2024 07:56
@lemnik lemnik force-pushed the PLAT-11195/improve-discardoldestfileifneeded branch from 91244bb to 5af062d Compare September 30, 2024 13:41
Copy link
Contributor

@lemnik lemnik left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants