Slide 1

Slide 1 text

Presented by Samantha Siow (she/her) REBUILDING A FASTER, LAZIER SLACK

Slide 2

Slide 2 text

LEGACY MODERN

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Handlebars & Smarty templates Manual DOM updates via jQuery Multiple processes for multiple workspaces Eager data loading LEGACY

Slide 5

Slide 5 text

5 YEARS

Slide 6

Slide 6 text

5 YEARS

Slide 7

Slide 7 text

All UI components built in React Single process for multiple workspaces Lazily-loaded and incomplete data model MODERN

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

1. Load less code upfront 2. Declutter your boot data 3. Prioritize initial API calls

Slide 10

Slide 10 text

1. Load less code upfront 2. Declutter your boot data 3. Prioritize initial API calls

Slide 11

Slide 11 text

LEGACY

Slide 12

Slide 12 text

700ms JS assets LEGACY

Slide 13

Slide 13 text

LEGACY 1750ms

Slide 14

Slide 14 text

Start initial API calls LEGACY

Slide 15

Slide 15 text

1. Lots of templates! 2. Lots of code! Problems:

Slide 16

Slide 16 text

MODERN

Slide 17

Slide 17 text

MODERN boot payload

Slide 18

Slide 18 text

700ms -> 160ms MODERN boot payload

Slide 19

Slide 19 text

Dynamically import JS bundles MODERN Start initial API calls

Slide 20

Slide 20 text

MODERN 800ms

Slide 21

Slide 21 text

But wait! There’s more!

Slide 22

Slide 22 text

MODERN (+ Service Worker!)

Slide 23

Slide 23 text

MODERN 700ms -> 160ms 36.9ms! boot payload (+ Service Worker!)

Slide 24

Slide 24 text

MODERN 550ms (+ Service Worker!)

Slide 25

Slide 25 text

1. Client-side rendering 2. Small boot payload 3. Code splitting 4. Use SW to cache assets Solutions:

Slide 26

Slide 26 text

1. Load less code upfront 2. Declutter your boot data 3. Prioritize initial API calls

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

Lots of data required to boot Problem:

Slide 29

Slide 29 text

https://www.onekingslane.com/live-love-home/marie-kondo-book-declutter/

Slide 30

Slide 30 text

OLD NEW Eager loading / Complete Model

Slide 31

Slide 31 text

OLD NEW Eager loading / Complete Model Lazy loading / Incomplete Model

Slide 32

Slide 32 text

???

Slide 33

Slide 33 text

???

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

Embrace the unknown Solution:

Slide 36

Slide 36 text

1. Load less code upfront 2. Declutter your boot data 3. Prioritize initial API calls

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

5750ms LEGACY

Slide 39

Slide 39 text

blocks first meaningful paint LEGACY

Slide 40

Slide 40 text

LEGACY not really blocking blocks first meaningful paint

Slide 41

Slide 41 text

1. API calls block boot 2. We have so many API calls Problems:

Slide 42

Slide 42 text

MODERN 2500ms

Slide 43

Slide 43 text

MODERN high priority

Slide 44

Slide 44 text

deferred MODERN high priority

Slide 45

Slide 45 text

parallel calls MODERN

Slide 46

Slide 46 text

1. Prioritize 2. Parallelize Solutions: 3. The early bird get the worm API calls first meaningful paint on the screen faster

Slide 47

Slide 47 text

Takeaways!

Slide 48

Slide 48 text

Load less code upfront Client-side rendering Small boot payload Code splitting Use SW to cache assets

Slide 49

Slide 49 text

Declutter your boot data Embrace the Unknown

Slide 50

Slide 50 text

Prioritize initial API calls Prioritize Parallelize Start API calls early

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

References & Credits Mark Christian & Johnny Rodgers - bit.ly/slack-rebuild When a rewrite isn’t: rebuilding Slack on the desktop Service Workers at Slack: Our Quest for Faster Boot Times and Offline Support Jim Whimpey - bit.ly/slack-sw Introducing a snappier, more efficient Slack desktop experience tiny.cc/slack-intro Slide theme: Bitter Sweet Templates for Keynote - DesiGN (https://apps.apple.com/us/app/themes-for-keynote/id935290998?mt=12) Anuj Nair - bit.ly/slack-gantry Gantry: Slack’s Fast-booting Frontend Framework Anuj Nair - bit.ly/slack-sonic Sonic: A Slack Modernization Project

Slide 53

Slide 53 text

slack.engineering References & Credits Mark Christian & Johnny Rodgers - bit.ly/slack-rebuild When a rewrite isn’t: rebuilding Slack on the desktop Service Workers at Slack: Our Quest for Faster Boot Times and Offline Support Jim Whimpey - bit.ly/slack-sw Introducing a snappier, more efficient Slack desktop experience tiny.cc/slack-intro Slide theme: Bitter Sweet Templates for Keynote - DesiGN (https://apps.apple.com/us/app/themes-for-keynote/id935290998?mt=12) Anuj Nair - bit.ly/slack-gantry Gantry: Slack’s Fast-booting Frontend Framework Anuj Nair - bit.ly/slack-sonic Sonic: A Slack Modernization Project

Slide 54

Slide 54 text

Thank you! samanthasiow.com ssiow@slack-corp.com