Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. Electron.js Desktop App Development

Lesson 19 of 28 · javascript

Performance Profiling – Chrome DevTools & Electron‑Performance

Duration: 9 mins

Performance Profiling – Chrome DevTools & Electron‑Performance

Chrome DevTools (renderer)

  • Open DevTools → Performance panel.
  • Record a session, look for long tasks, layout thrashing, paint time.
  • Use performance.now() in your code to measure custom sections.

Main‑process profiling

const { performance } = require('perf_hooks');
const start = performance.now();
// … heavy work …
const duration = performance.now() - start;
console.log(`Main work took ${duration.toFixed(2)} ms`);

Memory profiling

  • DevTools → Memory → take a heap snapshot.
  • Look for detached DOM trees or large JS objects.

Use electron‑performance (third‑party)

npm install electron-performance
const { monitor } = require('electron-performance');
monitor(app);

It logs CPU, memory and event‑loop lag.

Previous: Testing Electron Apps – Spectron & PlaywrightNext: Accessibility – Keyboard, ARIA & High‑Contrast