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

improve perf 3-5x by avoiding re-instantiating date formatter #356

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

Conversation

pelhage
Copy link

@pelhage pelhage commented Jan 2, 2024

Description

Querying workouts was taking an unexpectedly long time, so did a perf trace, saw that this code was the culprit:
image

Modified the code and re-ran my project and saw huge savings.

TBH not sure if this needs more extensive testing (are there unit tests?), but feedback is welcome.

BEFORE:
image
image
image
image

AFTER:
image
image

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have checked my code and corrected any misspellings

@pelhage pelhage changed the title (performance): improve perf 3-5x by re-instantiating date formatter (performance): improve perf 3-5x by avoiding re-instantiating date formatter Jan 2, 2024
@pelhage pelhage changed the title (performance): improve perf 3-5x by avoiding re-instantiating date formatter improve perf 3-5x by avoiding re-instantiating date formatter Jan 2, 2024
@pelhage pelhage marked this pull request as ready for review February 28, 2024 07:43
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.

None yet

1 participant