Skip to content

Memoize reused time ranges #906

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

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

Conversation

smcnamara2-stripe
Copy link
Contributor

Summary

  • Memoize the calculation of timeRanges in DFWithStats.
    • Can't easily store state in implicit class DataframeOps
  • Rename timeRange to calculateTimeRange to make clear there's work involved

Why / Goal

When calculating the ts ranges for unfilled partitions, we often do the same work repeatedly.

Internally at Stripe this has resulted in multi-hour wallclock savings for certain apps.

Test Plan

Covered by existing tests. Been running in prod at Stripe for months.

Checklist

  • Documentation update

Reviewers

Copy link
Collaborator

@pengyu-hou pengyu-hou left a comment

Choose a reason for hiding this comment

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

LGTM

@smcnamara2-stripe
Copy link
Contributor Author

@pengyu-hou had a chance to look at this?

@pengyu-hou
Copy link
Collaborator

@pengyu-hou had a chance to look at this?

Hi @smcnamara2-stripe I stamped it already.

@hzding621 , could you take a look?

@smcnamara2-stripe smcnamara2-stripe force-pushed the smcnamara/memoize-time-ranges branch from 3d21cfb to 5a5e80b Compare March 12, 2025 16:14
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