-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[1 of N] Optimizing Line, Area and Utility code for performance improvement #27263
Conversation
📊 Bundle size reportUnchanged fixtures
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: cbfa9a3717782183ebc86149abcde6468f97afa8 (build) |
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 5b002a4:
|
Perf Analysis (
|
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
Avatar | mount | 574 | 608 | 5000 | |
Button | mount | 280 | 297 | 5000 | |
Field | mount | 1082 | 1076 | 5000 | |
FluentProvider | mount | 652 | 636 | 5000 | |
FluentProviderWithTheme | mount | 79 | 70 | 10 | |
FluentProviderWithTheme | virtual-rerender | 66 | 69 | 10 | |
FluentProviderWithTheme | virtual-rerender-with-unmount | 80 | 84 | 10 | |
InfoButton | mount | 11 | 8 | 5000 | |
MakeStyles | mount | 817 | 849 | 50000 | |
Persona | mount | 1606 | 1557 | 5000 | |
SpinButton | mount | 1263 | 1281 | 5000 |
🕵 fluentuiv9 No visual regressions between this PR and main |
🕵 FluentUI-v0 No visual regressions between this PR and main |
Perf Analysis (
|
Scenario | Current PR Ticks | Baseline Ticks | Ratio |
---|---|---|---|
AttachmentMinimalPerf.default | 86 | 75 | 1.15:1 |
RefMinimalPerf.default | 115 | 104 | 1.11:1 |
IconMinimalPerf.default | 389 | 351 | 1.11:1 |
TreeWith60ListItems.default | 92 | 84 | 1.1:1 |
AlertMinimalPerf.default | 157 | 145 | 1.08:1 |
ChatWithPopoverPerf.default | 202 | 187 | 1.08:1 |
InputMinimalPerf.default | 552 | 513 | 1.08:1 |
AttachmentSlotsPerf.default | 661 | 626 | 1.06:1 |
AvatarMinimalPerf.default | 111 | 106 | 1.05:1 |
FormMinimalPerf.default | 231 | 221 | 1.05:1 |
AccordionMinimalPerf.default | 82 | 79 | 1.04:1 |
ChatDuplicateMessagesPerf.default | 152 | 146 | 1.04:1 |
DropdownMinimalPerf.default | 1457 | 1400 | 1.04:1 |
LabelMinimalPerf.default | 224 | 216 | 1.04:1 |
ListMinimalPerf.default | 317 | 304 | 1.04:1 |
ProviderMinimalPerf.default | 202 | 195 | 1.04:1 |
DropdownManyItemsPerf.default | 405 | 395 | 1.03:1 |
ListCommonPerf.default | 394 | 384 | 1.03:1 |
MenuButtonMinimalPerf.default | 965 | 940 | 1.03:1 |
SplitButtonMinimalPerf.default | 2303 | 2235 | 1.03:1 |
ButtonOverridesMissPerf.default | 660 | 644 | 1.02:1 |
ChatMinimalPerf.default | 448 | 439 | 1.02:1 |
DialogMinimalPerf.default | 455 | 448 | 1.02:1 |
FlexMinimalPerf.default | 154 | 151 | 1.02:1 |
ItemLayoutMinimalPerf.default | 707 | 693 | 1.02:1 |
MenuMinimalPerf.default | 498 | 487 | 1.02:1 |
ProviderMergeThemesPerf.default | 671 | 661 | 1.02:1 |
SegmentMinimalPerf.default | 199 | 195 | 1.02:1 |
SkeletonMinimalPerf.default | 201 | 198 | 1.02:1 |
SliderMinimalPerf.default | 754 | 741 | 1.02:1 |
TextAreaMinimalPerf.default | 296 | 290 | 1.02:1 |
ToolbarMinimalPerf.default | 546 | 535 | 1.02:1 |
VideoMinimalPerf.default | 438 | 431 | 1.02:1 |
GridMinimalPerf.default | 186 | 184 | 1.01:1 |
HeaderSlotsPerf.default | 468 | 465 | 1.01:1 |
ImageMinimalPerf.default | 212 | 209 | 1.01:1 |
LoaderMinimalPerf.default | 187 | 186 | 1.01:1 |
PortalMinimalPerf.default | 84 | 83 | 1.01:1 |
StatusMinimalPerf.default | 401 | 399 | 1.01:1 |
AnimationMinimalPerf.default | 298 | 298 | 1:1 |
ButtonMinimalPerf.default | 89 | 89 | 1:1 |
CheckboxMinimalPerf.default | 1151 | 1156 | 1:1 |
DatepickerMinimalPerf.default | 3684 | 3670 | 1:1 |
LayoutMinimalPerf.default | 201 | 201 | 1:1 |
ListWith60ListItems.default | 376 | 376 | 1:1 |
TableMinimalPerf.default | 240 | 240 | 1:1 |
TooltipMinimalPerf.default | 1253 | 1248 | 1:1 |
CardMinimalPerf.default | 308 | 310 | 0.99:1 |
CarouselMinimalPerf.default | 258 | 261 | 0.99:1 |
DividerMinimalPerf.default | 202 | 205 | 0.99:1 |
EmbedMinimalPerf.default | 1845 | 1867 | 0.99:1 |
HeaderMinimalPerf.default | 202 | 205 | 0.99:1 |
ListNestedPerf.default | 325 | 327 | 0.99:1 |
RadioGroupMinimalPerf.default | 265 | 268 | 0.99:1 |
TableManyItemsPerf.default | 1104 | 1117 | 0.99:1 |
TextMinimalPerf.default | 187 | 189 | 0.99:1 |
CustomToolbarPrototype.default | 1465 | 1483 | 0.99:1 |
BoxMinimalPerf.default | 194 | 197 | 0.98:1 |
RosterPerf.default | 1500 | 1528 | 0.98:1 |
PopupMinimalPerf.default | 354 | 360 | 0.98:1 |
ButtonSlotsPerf.default | 316 | 330 | 0.96:1 |
TreeMinimalPerf.default | 470 | 490 | 0.96:1 |
ReactionMinimalPerf.default | 207 | 218 | 0.95:1 |
Perf Analysis (
|
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
BaseButton | mount | 614 | 618 | 5000 | |
Breadcrumb | mount | 1641 | 1639 | 1000 | |
Checkbox | mount | 1681 | 1683 | 5000 | |
CheckboxBase | mount | 1451 | 1430 | 5000 | |
ChoiceGroup | mount | 2920 | 2919 | 5000 | |
ComboBox | mount | 638 | 653 | 1000 | |
CommandBar | mount | 6153 | 6134 | 1000 | |
ContextualMenu | mount | 12083 | 11981 | 1000 | |
DefaultButton | mount | 723 | 738 | 5000 | |
DetailsRow | mount | 2175 | 2215 | 5000 | |
DetailsRowFast | mount | 2201 | 2155 | 5000 | |
DetailsRowNoStyles | mount | 1976 | 1979 | 5000 | |
Dialog | mount | 2526 | 2527 | 1000 | |
DocumentCardTitle | mount | 225 | 226 | 1000 | |
Dropdown | mount | 1877 | 1948 | 5000 | |
FocusTrapZone | mount | 1081 | 1098 | 5000 | |
FocusZone | mount | 1024 | 1013 | 5000 | |
GroupedList | mount | 40572 | 40971 | 2 | |
GroupedList | virtual-rerender | 17650 | 19538 | 2 | |
GroupedList | virtual-rerender-with-unmount | 49387 | 49630 | 2 | |
GroupedListV2 | mount | 212 | 219 | 2 | |
GroupedListV2 | virtual-rerender | 202 | 206 | 2 | |
GroupedListV2 | virtual-rerender-with-unmount | 209 | 217 | 2 | |
IconButton | mount | 1059 | 1052 | 5000 | |
Label | mount | 334 | 337 | 5000 | |
Layer | mount | 2684 | 2687 | 5000 | |
Link | mount | 387 | 378 | 5000 | |
MenuButton | mount | 929 | 921 | 5000 | |
MessageBar | mount | 21003 | 21245 | 5000 | |
Nav | mount | 1904 | 1874 | 1000 | |
OverflowSet | mount | 793 | 777 | 5000 | |
Panel | mount | 1743 | 1734 | 1000 | |
Persona | mount | 717 | 726 | 1000 | |
Pivot | mount | 875 | 900 | 1000 | |
PrimaryButton | mount | 812 | 817 | 5000 | |
Rating | mount | 4512 | 4539 | 5000 | |
SearchBox | mount | 879 | 926 | 5000 | |
Shimmer | mount | 1842 | 1891 | 5000 | |
Slider | mount | 1330 | 1297 | 5000 | |
SpinButton | mount | 2831 | 2819 | 5000 | |
Spinner | mount | 376 | 372 | 5000 | |
SplitButton | mount | 1818 | 1758 | 5000 | |
Stack | mount | 408 | 409 | 5000 | |
StackWithIntrinsicChildren | mount | 850 | 870 | 5000 | |
StackWithTextChildren | mount | 2636 | 2607 | 5000 | |
SwatchColorPicker | mount | 5970 | 5963 | 5000 | |
TagPicker | mount | 1444 | 1490 | 5000 | |
Text | mount | 363 | 375 | 5000 | |
TextField | mount | 960 | 953 | 5000 | |
ThemeProvider | mount | 824 | 828 | 5000 | |
ThemeProvider | virtual-rerender | 592 | 591 | 5000 | |
ThemeProvider | virtual-rerender-with-unmount | 1236 | 1270 | 5000 | |
Toggle | mount | 587 | 613 | 5000 | |
buttonNative | mount | 184 | 193 | 5000 |
packages/react-charting/src/components/AreaChart/AreaChart.base.tsx
Outdated
Show resolved
Hide resolved
🕵 fluentuiv8 No visual regressions between this PR and main |
change/@fluentui-react-charting-effaa597-2236-4e8c-b8f3-91a2422c9f44.json
Show resolved
Hide resolved
change/@fluentui-react-charting-effaa597-2236-4e8c-b8f3-91a2422c9f44.json
Show resolved
Hide resolved
change/@fluentui-react-charting-effaa597-2236-4e8c-b8f3-91a2422c9f44.json
Show resolved
Hide resolved
packages/react-examples/src/react-charting/AreaChart/AreaChart.DataChange.Example.tsx
Show resolved
Hide resolved
🎉 Handy links: |
Previous Behavior
New Behavior
In this PR we have enhanced the performance by doing:
1.Optimizing code for Line, Area and cartesian chart. We have optimized time complexity for pre computational task which had impact FCP, TTI and TBTMetrics.
2. we have also made DOM lighter by limiting the precision digits for path
3. We have also used 2 flags in our code to roll out the performance changes , first flag enablePerfOptimization which is exposed to user to enable the performance related changes and second flag is _enableComputationOptimization(true by default) which is used internally and is not exposed to user. This second flag is used to control the individual performance changes in code. This will help in debugging code easily if some issue comes after rolling out the changes. _enableComputationOptimization is used for optimized code to group data points by x value from O(n^2) to O(n) using a map.
Performance improvement for Area, Line Charts
Related Issue(s)