Skip to content

Instantly share code, notes, and snippets.

@samarpanda
samarpanda / first-input-delay.md
Last active October 20, 2023 12:24
First input delay (FID)

First input delay(FID)

This is an interactive metric. Collected once user tries to interact with the page.

Using web-vitals npm package

import {getFID} from 'web-vitals';
getFID(console.log);
@samarpanda
samarpanda / docker.md
Created May 26, 2020 03:25
Docker cheatsheet

Talk about performance

  • LCP, FID, CLS, Other Perf timing API
  • Improving loading experience includes - link rel preload, Priority Hints, Native lazy loading using simple html image attributes etc
  • Various performance APIs - UserTiming, LongTask, ElementTiming, ResourceTiming, ServerTiming, PaintTiming etc.
  • Tips & Tricks around ChromeDevtools to profile, detect, address issues & repeat i.e overrides, log point, performance profiling.
  • Demistify values around webpagetest
  • Font optimization techniques
  • Explaing browser rendering pipeline
  • Progressive Web Apps - ServiceWorker as a reverse proxy
@samarpanda
samarpanda / case-study-01.md
Last active April 26, 2020 18:01
Performance case study 25-04-2020 bigbasket.com

bigbasket 3G Fast optimizing critical rendering path

  1. devtools performance comparison - https://bit.ly/bb-perf-01
  2. Simply using preload link to prioritize assets in view port
  3. Improves cumulative layout shift as well by reducing the content movements
  4. link rel preload can also to passed as response header.
@samarpanda
samarpanda / gist:6d7eecf7ce82b37f598dc6a3ed46babb
Created April 25, 2020 05:41
Bigbasket performance 3GFast throttled performance profile dump
We couldn’t find that file to show.
@samarpanda
samarpanda / Largest-Contentful-Paint.md
Last active June 23, 2020 17:22
How to measure largest contentful paint

Largest contentful paint

const po = new PerformanceObserver(list => {
  const entries = list.getEntries();
  const lastEntry = entries[entries.length - 1];
  console.log(`LCP is: ${lastEntry.startTime}`);
});
po.observe({ type: 'largest-contentful-paint', buffered: true })
@samarpanda
samarpanda / cumulative-layout-shift.md
Last active June 26, 2020 19:43
Calculative Cumulative Layout Shift(CLS) performance metric

Cumulative layout shift (CLS)

Using web-vitals npm package

import {getCLS} from 'web-vitals';
getCLS(console.log);
@samarpanda
samarpanda / Consul.md
Last active March 11, 2020 06:38
Consul quick commands

Consul

Installing Consul

  • brew install consul
  • consul -v

Running consul agent

In development mode