explaingit

zeman/perfmap

3,769JavaScriptAudience · developerComplexity · 1/5Setup · easy

TLDR

PerfMap is a browser bookmarklet and Chrome extension that draws color-coded overlays on webpage images to show exactly how long each one took to load, using the browser's built-in Resource Timing data.

Mindmap

mindmap
  root((PerfMap))
    What it does
      Load time heatmap
      Color overlays on images
      Timing numbers shown
    How it works
      Resource Timing API
      Browser built-in data
      Overlay rendering
    Usage
      Bookmarklet
      Chrome extension
      Click to activate
    Audience
      Web developers
      Performance auditors
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Visually identify which images are slowest to load on any webpage without opening DevTools

USE CASE 2

Show clients a color-coded heatmap of image load times during a web performance audit

USE CASE 3

Quickly diagnose which above-the-fold images are delaying the first visual impression of a page

Tech stack

JavaScriptChrome ExtensionResource Timing API

Getting it running

Difficulty · easy Time to first run · 5min

Firefox requires enabling the resource timing setting in about:config, Chrome works out of the box with no configuration.

License not specified in the explanation.

In plain English

PerfMap is a bookmarklet and Chrome extension that overlays a color-coded performance heatmap on any webpage. It shows you, at a glance, how long each image and visual resource on a page took to load before it appeared to the user. The tool uses the Resource Timing API, a feature built into modern browsers that records detailed timing information about every resource the browser fetches. To use it, you add the bookmarklet to your browser's bookmark bar or install the Chrome extension. After a page has finished loading, you click the bookmark or extension icon, and PerfMap draws colored overlays directly on top of each image on the page. The color indicates how far into the page load that resource finished loading. A number shown on each overlay tells you at what point the image became visible to the user (for example, 3450ms means the user waited 3.4 seconds before seeing that image), and a second number in brackets shows how long that individual resource took to download. A legend at the bottom of the page shows timing information for the full page load. Hovering over any colored area moves a timeline indicator to mark exactly when that resource finished loading. The tool works in Chrome without any configuration. In Firefox, it requires enabling a setting in the browser's advanced configuration page. The project originated as a data visualization experiment by Mark Zeman of SpeedCurve and was presented at Velocity New York in 2014. The repository shows active development from October 2014 and lists a handful of planned improvements, such as better support for fixed-position elements and resources loaded inside iframes.

Copy-paste prompts

Prompt 1
I'm using PerfMap on a page and several images show red overlays with numbers like 4200ms and 5800ms. Explain what those numbers mean and what I should fix to improve those load times.
Prompt 2
I want to build something similar to PerfMap that overlays timing data on all resource types, not just images. Show me how to use the Resource Timing API in JavaScript to get timing data for scripts and stylesheets too.
Prompt 3
Walk me through converting the PerfMap bookmarklet into a modern Chrome Manifest V3 extension with a toolbar button icon.
Prompt 4
PerfMap shows a number in brackets next to the main load time. Explain the difference between when a resource finished loading and how long the individual download took.
Open on GitHub → Explain another repo

← zeman on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.