Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

perf(tooltip): Simplify rendering when tooltip is not visible #1981

Merged
merged 13 commits into from
Oct 4, 2019

Conversation

jurokapsiar
Copy link
Contributor

@jurokapsiar jurokapsiar commented Sep 27, 2019

Based on the perf measurements, I found out that adding tooltips to the toolbar items has significant perf impact (~20% on my machine). This PR simplifies the rendering if the tooltip is not visible (it has to be in the DOM for accessibility purposes). The change seems to get back half of the degradation, see the perf measurements below.

Added CustomToolbar.perf.tsx to do the measurements.

Before:

Example Avg Avg diff Avg Normalized Avg Normalized diff Median Median diff Median Normalized Median Normalized diff
CustomToolbar.perf.tsx 119.07 119.07 63.41 63.41 108.14 108.14 60.48 60.48

After:

Example Avg Avg diff Avg Normalized Avg Normalized diff Median Median diff Median Normalized Median Normalized diff
CustomToolbar.perf.tsx 97.46 97.46 52.73 52.73 88.64 88.64 50.2 50.2

@vercel vercel bot temporarily deployed to staging September 30, 2019 05:39 Inactive
@codecov
Copy link

codecov bot commented Oct 2, 2019

Codecov Report

Merging #1981 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1981   +/-   ##
=======================================
  Coverage   77.01%   77.01%           
=======================================
  Files         158      158           
  Lines        5456     5456           
  Branches     1578     1578           
=======================================
  Hits         4202     4202           
  Misses       1241     1241           
  Partials       13       13
Impacted Files Coverage Δ
packages/react/src/components/Tooltip/Tooltip.tsx 62.5% <ø> (ø) ⬆️
...es/react/src/components/Tooltip/TooltipContent.tsx 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3a28a5b...85d5034. Read the comment docs.

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

Successfully merging this pull request may close these issues.

2 participants