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

fix: don't call clearTimeout unnecessarily #30109

Conversation

ling1726
Copy link
Member

This is a preventative PR to address performance concerns that have been brought up by partners. There's no evidence of perf regression, but it shows up enough in traces that it might be nice to avoid.

Updates the popover state so that the hover delay timeout is only cleared if it actually exists.

This is a preventative PR to address performance concerns that have been
brought up by partners. There's no evidence of perf regression, but it
shows up enough in traces that it might be nice to avoid.

Updates the popover state so that the hover delay timeout is only
cleared if it **actually exists**.
@ling1726 ling1726 marked this pull request as ready for review December 18, 2023 17:08
@ling1726 ling1726 requested a review from a team as a code owner December 18, 2023 17:08
@fabricteam
Copy link
Collaborator

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 629 640 5000
Button mount 304 310 5000
Field mount 1141 1112 5000
FluentProvider mount 694 705 5000
FluentProviderWithTheme mount 84 78 10
FluentProviderWithTheme virtual-rerender 64 61 10
FluentProviderWithTheme virtual-rerender-with-unmount 74 78 10
MakeStyles mount 856 886 50000
Persona mount 1775 1681 5000
SpinButton mount 1351 1363 5000

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e33c725:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@fabricteam
Copy link
Collaborator

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
209.769 kB
59.924 kB
209.826 kB
59.957 kB
57 B
33 B
react-infobutton
InfoButton
132.639 kB
41.721 kB
132.696 kB
41.749 kB
57 B
28 B
react-infobutton
InfoLabel
136.326 kB
42.862 kB
136.383 kB
42.886 kB
57 B
24 B
react-popover
Popover
120.804 kB
38.11 kB
120.861 kB
38.139 kB
57 B
29 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-alert
Alert
83.729 kB
23.458 kB
react-avatar
Avatar
50.167 kB
15.945 kB
react-avatar
AvatarGroup
19.696 kB
7.795 kB
react-avatar
AvatarGroupItem
64.823 kB
20.274 kB
react-components
react-components: Button, FluentProvider & webLightTheme
69.893 kB
20.261 kB
react-components
react-components: FluentProvider & webLightTheme
42.38 kB
14.104 kB
react-datepicker-compat
DatePicker Compat
213.412 kB
59.838 kB
react-persona
Persona
57.058 kB
17.822 kB
react-portal-compat
PortalCompatProvider
7.101 kB
2.386 kB
react-table
DataGrid
154.888 kB
43.533 kB
react-table
Table (Primitives only)
43.891 kB
13.782 kB
react-table
Table as DataGrid
128.109 kB
34.792 kB
react-table
Table (Selection only)
73.288 kB
20.017 kB
react-table
Table (Sort only)
71.895 kB
19.617 kB
react-tags
InteractionTag
15.251 kB
6.058 kB
react-tags
Tag
29.974 kB
9.44 kB
react-tags
TagGroup
74.323 kB
22.28 kB
🤖 This report was generated against 2034818a2dd109f3e9f7bb5cdf4caae47a9116d4

@fabricteam
Copy link
Collaborator

🕵 fluentuiv9 No visual regressions between this PR and main

Copy link

size-auditor bot commented Dec 18, 2023

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 2034818a2dd109f3e9f7bb5cdf4caae47a9116d4 (build)

Copy link
Member

@layershifter layershifter left a comment

Choose a reason for hiding this comment

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

This change is against common sense: native functions like setTimeount() and clearTimeout() are blazing fast. This PR complicates logic and probably is more harmful for performance due an additional hook invoked.

This pull request has been automatically marked as stale because it was marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 5 days of this comment. Thank you for your contributions to Fluent UI!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants