mozilla / perfcompare

Improved Performance Comparison Tool
Mozilla Public License 2.0
39 stars 93 forks source link

Memoize the fetches for the revision information #701

Closed julienw closed 2 months ago

julienw commented 2 months ago

The goal for this patch is to memoize the result of fetching the revision information for specific revisions.

This has 2 commits:

  1. Commit 1 is a preparation commit: this creates a specific function for this operation, so that it can be memoized in step 2.
  2. Commit 2 uses the library https://github.com/planttheidea/moize to implement the memoization itself. I looked at many libraries and decided to use this one because of its simple yet effective API, with all the features we need here. Especially it makes it easy to use an option object for the function, and configure the number of calls to be memoized. It can also be configured with an expiration, which could be useful for us later if we decide to use it for the results (maybe), and the cache can also be controlled from outside, which can be useful if we'd want to prime it from the revision selections in the home page.
netlify[bot] commented 2 months ago

Deploy Preview for mozilla-perfcompare ready!

Name Link
Latest commit 5555e6a94e4d88b37cda649a277aaa74246ee960
Latest deploy log https://app.netlify.com/sites/mozilla-perfcompare/deploys/66abbcf48182b000088d2908
Deploy Preview https://deploy-preview-701--mozilla-perfcompare.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.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.

Project coverage is 82.90%. Comparing base (b6cb2ad) to head (5555e6a).

Files Patch % Lines
src/logic/treeherder.ts 83.33% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## beta #701 +/- ## ========================================== - Coverage 82.92% 82.90% -0.03% ========================================== Files 82 82 Lines 2091 2094 +3 Branches 379 379 ========================================== + Hits 1734 1736 +2 - Misses 316 317 +1 Partials 41 41 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.