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

Shallow compare performance optimization #12133

Merged
merged 3 commits into from Mar 10, 2020

Conversation

chce
Copy link
Contributor

@chce chce commented Feb 29, 2020

Pull request checklist

Description of changes

I've removed the last equality check in shallowCompare. Either the objects will have all the same properties, in which case it will be fine to only check on the run through of object A, or they will have differing properties, in which case it will be caught in either of the two run-throughs of the properties.

Focus areas to test

DetailsList's useReducedRowRenderer, and other components that use this function for object comparison

Microsoft Reviewers: Open in CodeFlow

@msft-github-bot
Copy link
Contributor

Perf Analysis

No significant results to display.

All results

Scenario Master Ticks PR Ticks Status
BaseButton 821 812
BaseButton (experiments) 1040 1025
DefaultButton 1101 1085
DefaultButton (experiments) 2059 2077
DetailsRow 3648 3684
DetailsRow (fast icons) 3638 3703
DetailsRow without styles 3422 3337
DocumentCardTitle with truncation 1561 1586
MenuButton 1436 1533
MenuButton (experiments) 3711 3741
PrimaryButton 1256 1309
PrimaryButton (experiments) 2119 2124
SplitButton 3154 3114
SplitButton (experiments) 7344 7323
Stack 503 504
Stack with Intrinsic children 1161 1153
Stack with Text children 4528 4617
Text 439 403
Toggle 945 935
Toggle (experiments) 2376 2375
button 76 67

Perf Analysis (Fluent)

⚠️ 1 potential perf regressions detected

Potential regressions comparing to master

Scenario Current PR Ticks Baseline Ticks Ratio Regression Analysis
ButtonMinimalPerf.default 182 171 1.06:1 analysis
Perf comparison
Status Scenario Fluent TPI Fabric TPI Ratio Iterations Ticks
🔧 Avatar.Fluent 0.58 0.54 1.07:1 2000 1152
🎯 Button.Fluent 0.19 0.26 0.73:1 1000 187
🔧 Checkbox.Fluent 0.96 0.45 2.13:1 1000 961
🔧 Dialog.Fluent 0.41 0.25 1.64:1 5000 2043
🔧 Dropdown.Fluent 3.99 0.57 7:1 1000 3990
🔧 Icon.Fluent 0.19 0.06 3.17:1 5000 954
🦄 Image.Fluent 0.08 0.12 0.67:1 5000 389
🔧 Slider.Fluent 1.67 0.48 3.48:1 1000 1667
🔧 Text.Fluent 0.09 0.02 4.5:1 5000 426
🦄 Tooltip.Fluent 0.13 17.23 0.01:1 5000 648

🔧 Needs work     🎯 On target     🦄 Amazing

Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
IconMinimalPerf.default 486 429 1.13:1
ImageMinimalPerf.default 408 372 1.1:1
Button.Fluent 187 171 1.09:1
VideoMinimalPerf.default 1164 1080 1.08:1
ChatWithPopoverPerf.default 683 641 1.07:1
BoxMinimalPerf.default 388 366 1.06:1
DividerMinimalPerf.default 1219 1152 1.06:1
ListWith60ListItems.default 220 207 1.06:1
TreeMinimalPerf.default 1432 1351 1.06:1
ButtonSlotsPerf.default 865 823 1.05:1
HeaderMinimalPerf.default 714 679 1.05:1
Image.Fluent 389 369 1.05:1
Text.Fluent 426 404 1.05:1
AnimationMinimalPerf.default 769 739 1.04:1
AvatarMinimalPerf.default 635 610 1.04:1
GridMinimalPerf.default 1064 1020 1.04:1
LoaderMinimalPerf.default 1177 1137 1.04:1
RadioGroupMinimalPerf.default 694 666 1.04:1
StatusMinimalPerf.default 378 362 1.04:1
AlertMinimalPerf.default 687 667 1.03:1
ProviderMinimalPerf.default 680 658 1.03:1
RefMinimalPerf.default 226 220 1.03:1
Slider.Fluent 1667 1620 1.03:1
AttachmentMinimalPerf.default 1011 989 1.02:1
DialogMinimalPerf.default 2116 2073 1.02:1
ListCommonPerf.default 1168 1149 1.02:1
PortalMinimalPerf.default 336 329 1.02:1
ReactionMinimalPerf.default 2787 2737 1.02:1
TextAreaMinimalPerf.default 3520 3439 1.02:1
ToolbarMinimalPerf.default 1330 1299 1.02:1
TreeWith60ListItems.default 291 284 1.02:1
DropdownMinimalPerf.default 4078 4019 1.01:1
EmbedMinimalPerf.default 6923 6883 1.01:1
FormMinimalPerf.default 1170 1154 1.01:1
ListNestedPerf.default 1074 1062 1.01:1
MenuButtonMinimalPerf.default 2272 2259 1.01:1
PopupMinimalPerf.default 474 471 1.01:1
ProviderMergeThemesPerf.default 1389 1369 1.01:1
TooltipMinimalPerf.default 947 940 1.01:1
Avatar.Fluent 1152 1138 1.01:1
Tooltip.Fluent 648 639 1.01:1
AccordionMinimalPerf.default 282 281 1:1
ChatMinimalPerf.default 653 654 1:1
CheckboxMinimalPerf.default 4531 4537 1:1
HeaderSlotsPerf.default 2081 2078 1:1
InputMinimalPerf.default 1134 1139 1:1
LayoutMinimalPerf.default 806 806 1:1
ListMinimalPerf.default 485 483 1:1
MenuMinimalPerf.default 2345 2335 1:1
SegmentMinimalPerf.default 1336 1340 1:1
SplitButtonMinimalPerf.default 13903 13905 1:1
CustomToolbarPrototype.default 4069 4053 1:1
Checkbox.Fluent 961 961 1:1
CarouselMinimalPerf.default 2191 2221 0.99:1
HierarchicalTreeMinimalPerf.default 1244 1261 0.99:1
ItemLayoutMinimalPerf.default 2484 2506 0.99:1
SliderMinimalPerf.default 1655 1666 0.99:1
ChatDuplicateMessagesPerf.default 479 490 0.98:1
DropdownManyItemsPerf.default 407 415 0.98:1
Dialog.Fluent 2043 2095 0.98:1
Dropdown.Fluent 3990 4051 0.98:1
Icon.Fluent 954 978 0.98:1
AttachmentSlotsPerf.default 3888 4014 0.97:1
FlexMinimalPerf.default 563 588 0.96:1
LabelMinimalPerf.default 409 424 0.96:1
TableMinimalPerf.default 778 808 0.96:1
TextMinimalPerf.default 415 431 0.96:1

@size-auditor
Copy link

size-auditor bot commented Feb 29, 2020

Asset size changes

Project Bundle Baseline Size New Size Difference
office-ui-fabric-react SelectedItemsList 214.617 kB 214.646 kB ExceedsBaseline     29 bytes
office-ui-fabric-react ComboBox 228.811 kB 228.84 kB ExceedsBaseline     29 bytes
office-ui-fabric-react Utilities 65.748 kB 65.776 kB ExceedsBaseline     28 bytes
office-ui-fabric-react DocumentCard 200.515 kB 200.543 kB ExceedsBaseline     28 bytes
office-ui-fabric-react DetailsList 209.815 kB 209.843 kB ExceedsBaseline     28 bytes
office-ui-fabric-react Pivot 172.052 kB 172.08 kB ExceedsBaseline     28 bytes
office-ui-fabric-react Pickers 267.871 kB 267.899 kB ExceedsBaseline     28 bytes
office-ui-fabric-react Dialog 193.829 kB 193.857 kB ExceedsBaseline     28 bytes
office-ui-fabric-react PersonaCoin 107.71 kB 107.738 kB ExceedsBaseline     28 bytes
office-ui-fabric-react Persona 107.71 kB 107.738 kB ExceedsBaseline     28 bytes
office-ui-fabric-react Panel 185.461 kB 185.489 kB ExceedsBaseline     28 bytes
office-ui-fabric-react Nav 174.349 kB 174.377 kB ExceedsBaseline     28 bytes
office-ui-fabric-react Dropdown 216.815 kB 216.843 kB ExceedsBaseline     28 bytes
office-ui-fabric-react MessageBar 175.305 kB 175.333 kB ExceedsBaseline     28 bytes
office-ui-fabric-react Facepile 195.688 kB 195.716 kB ExceedsBaseline     28 bytes
office-ui-fabric-react Tooltip 80.368 kB 80.396 kB ExceedsBaseline     28 bytes
office-ui-fabric-react FloatingPicker 224.447 kB 224.475 kB ExceedsBaseline     28 bytes
office-ui-fabric-react KeytipLayer 98.152 kB 98.18 kB ExceedsBaseline     28 bytes
office-ui-fabric-react Keytip 75.611 kB 75.639 kB ExceedsBaseline     28 bytes
office-ui-fabric-react Grid 166.818 kB 166.846 kB ExceedsBaseline     28 bytes
office-ui-fabric-react ContextualMenu 146.811 kB 146.839 kB ExceedsBaseline     28 bytes
office-ui-fabric-react DatePicker 201.186 kB 201.214 kB ExceedsBaseline     28 bytes
office-ui-fabric-react HoverCard 95.276 kB 95.304 kB ExceedsBaseline     28 bytes
office-ui-fabric-react Coachmark 92.493 kB 92.521 kB ExceedsBaseline     28 bytes
office-ui-fabric-react Breadcrumb 184.312 kB 184.34 kB ExceedsBaseline     28 bytes
office-ui-fabric-react SwatchColorPicker 177.115 kB 177.143 kB ExceedsBaseline     28 bytes
office-ui-fabric-react ShimmeredDetailsList 220.307 kB 220.335 kB ExceedsBaseline     28 bytes
office-ui-fabric-react SearchBox 173.004 kB 173.032 kB ExceedsBaseline     28 bytes
office-ui-fabric-react TeachingBubble 190.379 kB 190.407 kB ExceedsBaseline     28 bytes
office-ui-fabric-react Callout 80.172 kB 80.197 kB ExceedsBaseline     25 bytes
office-ui-fabric-react CommandBar 186.685 kB 186.71 kB ExceedsBaseline     25 bytes
office-ui-fabric-react SpinButton 179.051 kB 179.074 kB ExceedsBaseline     23 bytes
office-ui-fabric-react Button 179.492 kB 179.515 kB ExceedsBaseline     23 bytes

ExceedsTolerance Over Tolerance (1024 B) ExceedsBaseline Over Baseline BelowBaseline Below Baseline New New Deleted  Removed 1 kB = 1000 B

Baseline commit: 159f0a80ea9d639f2cd0279bd6a9f7af4383d16f (build)

@dzearing dzearing merged commit 2409073 into microsoft:master Mar 10, 2020
@msft-github-bot
Copy link
Contributor

🎉@uifabric/utilities@v7.13.2 has been released which incorporates this pull request.:tada:

Handy links:

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.

Unnecessary comparison in shallowCompare
3 participants