Skip to content

Instantly share code, notes, and snippets.

View jinja12's full-sized avatar

Swayam jinja12

View GitHub Profile
@noamr
noamr / whynp.js
Last active May 28, 2024 17:20
WhyNP: Analyze LoAFs & event timing entries to find cause of bad INP
(function() {
let pending_loaf_entries = [];
let pending_event_entries = [];
let timeout_handle = null;
const combined_map = new Map();
function print() {
const entries = [...combined_map.entries()].sort((a, b) => b.duration - a.duration);
console.log(entries.map(([loaf, event]) => {
let longest_script = null;