# Frontend performance

> How many kilobytes does a convenience cost the visitor?

- Status: Open
- Record count: 1
- Source: https://muhammetsafak.com/research/program/frontend-performance/
- Language: en-US
- Author: Muhammet Şafak

---
Every convenience in a frontend ships bytes to the visitor; this archive measures how many kilobytes, along with first paint and interaction delay. Its first record shows that the way you import Chart.js decides how much the visitor downloads. If you want to see the price of a library before adding it, this is the place to start.

Shipped JS, first paint and interaction delay: how many kilobytes a convenience costs the visitor, browser support and the test setup included.

## Findings ledger

### How you import Chart.js decides how many kilobytes the visitor downloads

- Question: In a real production build, what is the difference between `chart.js/auto` and a selective `Chart.register()` — in kilobytes?
- Finding: Selective registration saves 9.7 kB gzip over `chart.js/auto` (67.8 → 58.1 kB, 14.3%). The larger drop is not in the library core but in leaving unused controllers out: a page that registers only the bar chart falls to 46.0 kB — two thirds of auto.
- https://muhammetsafak.com/research/chartjs-import-strategy/
- Markdown: https://muhammetsafak.com/research/chartjs-import-strategy.md
