Skip to content

Instantly share code, notes, and snippets.

@anniesullie
anniesullie / InteractionsEventTiming.js
Last active April 2, 2024 16:41
This gist pokes around with interactions in the EventTiming API. It tries to get the interaction latency, delay, processing time breakdown, type, and target.
const interactionMap = new Map();
function logInteraction(interaction) {
const clamp = val => Math.round(val * 100) / 100; // clamp to 2 decimal places
console.groupCollapsed(`${interaction.type} interaction`, clamp(interaction.latency));
console.log(`total latency`, clamp(interaction.latency));
console.log('delay:', clamp(interaction.delay));
console.groupCollapsed(`processing time in ${Object.entries(interaction.processingTimes).length} entries:`, clamp(interaction.processingTime));
for (const [e, t] of Object.entries(interaction.processingTimes)) {
/**
* A bookmarklet for viewing shifted elements while debugging
* Cumulative Layout Shift (web.dev/cls). Works in Chrome 84+
* Shows the previous position of shifted elements in yellow,
* and the new position in red. Adds in a `debugger;` statement
* each timet the performance observer is notified of a layout
* shift, allowing the user to attempt to "step through" the
* shifts by pausing on each one in the devtools debugger.
* Note that the shifts have already happened at this point.
*

Keybase proof

I hereby claim:

  • I am anniesullie on github.
  • I am anniesullie (https://keybase.io/anniesullie) on keybase.
  • I have a public key ASAetxcHFerPYPP1Vsnejv1W5ijDhgPRKt4I9B6xeWH-_Ao

To claim this, I am signing this object:

/**
* A bookmarklet for viewing the largest contentful paint in a page.
* Will show each LCP after the bookmarklet is clicked.
*
* To install:
* 1. Copy the code starting from the line beginning `javascript:`
* 2. Add a new bookmark in Chrome, and paste the code in as the URL.
**/
javascript:(function(){
try {
@anniesullie
anniesullie / CumulativeLayoutShiftBookmarklet.js
Last active February 13, 2023 07:52
Bookmarklet for showing Cumulative Layout Shift
/**
* A bookmarklet for viewing shifted elements while debugging
* Cumulative Layout Shift (web.dev/cls). Works in Chrome 84+
* Shows the previous position of shifted elements in yellow,
* and the new position in red.
*
* To install:
* 1. Copy the code starting from the line beginning `javascript:`
* 2. Add a new bookmark in Chrome, and paste the code in as the URL.
**/
@anniesullie
anniesullie / designer.html
Last active March 16, 2016 16:51
designer
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../paper-radio-group/paper-radio-group.html">
<link rel="import" href="../paper-radio-button/paper-radio-button.html">
<polymer-element name="my-element">
<template>
<style>
:host {

Perf Regression Sheriffing

The perf regression sheriff tracks performance regressions in Chrome's continuous integration tests. Note that a new rotation has been created to ensure the builds and tests stay green, so the perf regression sheriff role is now entirely focused on performance.

Key Responsibilities