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: Improve rendering cycle of TZ Label #17532

Merged
merged 7 commits into from
Sep 21, 2023
Merged

Conversation

benjackwhite
Copy link
Contributor

@benjackwhite benjackwhite commented Sep 19, 2023

Problem

Doing some performance improvements to Notebooks and noticed that a component that really over-rendered and potentially causes a lot of lists to really act silly is the good old TZLabel. 99% of the time the rerender does nothing...

This component is everywhere so perf improvements here are worth it.

Changes

  • Instead of re-rendering on every change, recalculate the display and only re-render if it changed.
  • Pull out the popover content to memoize it.

Flame graph diff on Events table

Before After
Screenshot 2023-09-19 at 18 34 27 Screenshot 2023-09-19 at 18 35 03
Screenshot 2023-09-20 at 09 30 19 Screenshot 2023-09-20 at 09 29 26

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

How did you test this code?

@benjackwhite benjackwhite changed the title Improve rendering cycle of TZ Label feat: Improve rendering cycle of TZ Label Sep 20, 2023
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Member

@Twixes Twixes left a comment

Choose a reason for hiding this comment

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

Awesome

@Twixes Twixes marked this pull request as ready for review September 20, 2023 11:21
# Conflicts:
#	playwright/e2e-vrt/layout/Navigation.spec.ts-snapshots/Navigation-App-Page-With-Side-Bar-Hidden-Mobile-1-chromium-linux.png
@benjackwhite benjackwhite merged commit 50af54f into master Sep 21, 2023
72 checks passed
@benjackwhite benjackwhite deleted the fix/timezone-rerendering branch September 21, 2023 14:19
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