Slide 1

Slide 1 text

The Butterfly Effect How seemingly insignificant browser details have a huge impact on performance

Slide 2

Slide 2 text

Jai Santhosh, Sr. Engineer @ Microsoft @jaisanth

Slide 3

Slide 3 text

What I do? Microsoft Search • Cohesive search experience in Native UI across 6 platforms • Multiple Host Apps What we’ll talk about? • Web Performance • Consistency across browsers

Slide 4

Slide 4 text

Microsoft Search

Slide 5

Slide 5 text

What we’ll look at now? • File Result Expand Animation - Rendering

Slide 6

Slide 6 text

Dev Test App

Slide 7

Slide 7 text

Prod Host App

Slide 8

Slide 8 text

Prod Host App

Slide 9

Slide 9 text

onClick Latency

Slide 10

Slide 10 text

Fix Layout Thrashing

Slide 11

Slide 11 text

FLIP Technique FLIP stands for First, Last, Invert, Play • First: The initial state of the element(s) involved in the transition. You can use element.getBoundingClientRect() for this • Last: The final state of the element(s). • Invert: Since the element is in the last position, we want to create the illusion that its in the first position, by using transform to modify its position and dimensions. • Play: With the element inverted (and pretending to be in the first position), we can move it back to its last position by setting its transform to none. https://aerotwist.com/blog/flip-your-animations/

Slide 12

Slide 12 text

FLIP Technique

Slide 13

Slide 13 text

With FLIP

Slide 14

Slide 14 text

More painful points?

Slide 15

Slide 15 text

Browser Inconsistencies • Layout caching • Interfering animations • Opacity + Animations • Anti-aliasing • Animation synchronization • Keyframes + Timing function • Animated GIFs •window.requestAnimationFrame() • CSS injection • Stylesheet API bugs • Rendering Pipeline • ScreenReader • Focus decoration • Fonts • Performance • Dev Tools • Microtasks

Slide 16

Slide 16 text

Conclusion • Read about perf optimization • Expect the unexpected! - Might spend time on unexpected obstacles • Test on all browsers

Slide 17

Slide 17 text

Thanks! @jaisanth