Loading video player…

Welcome to the Match Log Investigation

You’ll measure where JavaScript spends its time, see what its engine learns, trace what keeps objects alive, and read the specification. Your project: find out why a game server’s match-log processor, which keeps a match history and the standings, slows down.

Here’s a first taste. Tonight’s log has three matches. The processor records each one in its history and adds up each team’s points:

Language: JavaScript
const history = [];
const totals = new Map();

function recordMatch(match) {
  history.push(match);
  const current = totals.get(match.team) ?? 0;
  totals.set(match.team, current + match.points);
}

recordMatch({ id: "M1", team: "Falcons", points: 3 });
recordMatch({ id: "M2", team: "Owls", points: 2 });
recordMatch({ id: "M3", team: "Falcons", points: 4 });

console.log(totals);
console.log(history.length);

The totals print, Falcons 7 and Owls 2, and the history holds all three matches:

Language: Program Output
Map(2) { 'Falcons' => 7, 'Owls' => 2 }
3

The scores are right, but nothing takes a match out of the history. On the server, the history keeps every match all day. And the standings, the totals above, refresh more slowly. Where does the time go, and what keeps the matches alive?

By the end of this course, you’ll be able to:

  • Profile before changing code, and time it fairly
  • Explain what the engine learns, and keep records consistent
  • Trace what keeps a match alive, attach notes without owning players, and keep cleanup explicit
  • Settle a question with the specification

You need to know CPython’s bytecode, reference counting, garbage collection and profiling. In JavaScript, you need Maps, arrays, objects, functions and modules.

You need a current version of Node, and no packages. The examples use Node 26 and Python 3.15. Timings, profiles and memory readings vary by machine and Node version, so each one in the course is labeled as an observation, not a promise.

The course mixes short videos with text lessons and exercises. Every video has a summary below it. A quiz and a summary close the course.

Next up: Finding the Expensive Work, where you profile 50,000 match rows before changing anything.

Download

Course Slides (.pdf)

731.5 KB
Download

Sample Code (.zip)

10.3 KB

00:00 Welcome to JavaScript Under the Hood for Pythonistas! You’ll measure where JavaScript spends its time, see what its engine learns, trace what keeps objects alive, and read the specification.

00:12 Your project: find out why a game server’s match-log processor, which keeps a match history and the standings, slows down. Here’s a first taste.

00:23 Tonight’s log has three matches. The processor records each one in its history and adds up each team’s points. The totals print: Falcons seven, Owls two. The scores are right.

00:38 The history holds all three, and nothing takes one out. On the server, the history keeps every match all day. And the standings refresh more slowly. Where does the time go, and what keeps the matches alive?

00:54 You’ll profile before changing code, and time it fairly. You’ll explain what the engine learns, and keep records consistent. You’ll trace what keeps a match alive, attach notes without owning players, and keep cleanup explicit.

01:10 You’ll settle a question with the specification.

01:14 You need to know CPython’s bytecode, reference counting, garbage collection and profiling. In JavaScript, you need Maps, arrays, objects, functions and modules.

01:26 You need a current version of Node, and the examples use Node 26 and Python 3.15. Timings, profiles and memory readings vary by machine and Node version, so each is labeled an observation, not a promise.

01:42 Short videos mix with text lessons and exercises, and every video has a summary. A quiz and a summary close the course. Next up: Finding the Expensive Work, where you profile 50,000 match rows before changing anything.

Become a Member to join the conversation.