ptop: a vtop alternative in Rust with lower memory use

•Pate Bryant

I like vtop. I wanted a more performant version that works exactly the same, so I made ptop, short for Pate's top. It's a copy of vtop, rewritten in Rust.

The dotted graphs are the point. So are the process list, the keyboard controls, and the themes. I wanted to keep the terminal monitor I already liked and reduce the resources it uses to tell me what is using my resources.

If you're looking for a vtop alternative with lower memory use, that's the job ptop is meant to do. If you're choosing a monitor from scratch, I also compared htop, btop, vtop, and ptop. They have different strengths.

If you just want vtop itself, see how to install and use vtop.

I didn't write ptop by hand. Coding agents built it against vtop's source as the test oracle. How I run agentic workflows walks through that build.

The code is on GitHub, and the native executable is available as @patebryant/ptop on npm.

In a matched test on my Mac, ptop used about 73% less CPU and 92% less own-process memory than the original vtop. The side-by-side comparison below shows the numbers and how I measured them.

ptop terminal system monitor with purple dotted CPU and memory graphs, a process list, and keyboard controls

Rendered by ptop using synthetic demonstration data. The font depends on your terminal.

Try ptop

ptop runs on macOS and Linux. The installation method depends on your platform.

macOS: install from npm

For Apple Silicon Macs running macOS 15 or later, install the prebuilt native package:

npm install -g @patebryant/ptop@0.1.3
ptop

Press q to quit. You don't need to install Rust. npm distributes the compiled native executable; there is no resident Node wrapper or install-time binary download.

The command above also upgrades an existing npm installation. Quit any running ptop session and restart it after upgrading; ptop --version should report 0.1.3.

Linux: install from source

Linux has its own CPU and memory sensors, and Ubuntu builds, compatibility checks, and live-terminal tests run in CI alongside macOS. With Rust 1.92.0 installed and the usual Linux tools (ps, free, hostname, and killall) available:

cargo install --git https://github.com/patebry/ptop --locked
ptop

The npm package currently includes only the macOS ARM64 binary. That is a packaging limit, not a Mac-only limit on ptop itself. Other Linux distributions and CPU architectures have not all been verified, and Intel Mac source builds are not yet verified.

How close is it to vtop?

Matching vtop's appearance and behavior is the goal, including its dotted CPU and memory history, process grouping, sorting, keyboard navigation, mouse selection, and 12 themes. The reference is vtop 0.6.1.

The test harness checks 90 fixture frames against the upstream renderer, plus a separate ptop branding frame. It also tests command-line output, input handling, sensor timing, and terminal restoration. Those checks give us specific evidence of compatibility; they don't prove every possible terminal and workload behaves identically.

A few differences are deliberate. It says ptop, the old footer link is gone, and updates are manual. Normal ptop does not poll npm in the background or invoke sudo to update itself.

For reference testing, --vtop-parity restores vtop's branding, footer, updater behavior, and original collectors. For everyday use, just run ptop. The optional --fix flag corrects vtop's macOS memory arithmetic; the default retains the compatibility behavior.

ptop vs the original vtop: CPU and memory

I tested the published ptop 0.1.3 executable directly against vtop 0.6.1, using the same terminal dimensions, theme, and refresh interval. These are medians across four matched 30-second runs per tool:

Measurementvtop 0.6.1ptop 0.1.3
Median CPU (one core)34.80%9.24%
Median own-process RSS123.72 MiB9.33 MiB

That's 73.5% less CPU and 92.5% less own-process memory, calculated from the unrounded medians. Across the four runs, CPU ranged from 33.49–35.01% for vtop and 8.07–9.48% for ptop. Average own-process RSS ranged from 123.13–124.57 MiB for vtop and 9.27–9.51 MiB for ptop.

The machine was an Apple M2 Max with 12 logical CPUs and 96 GiB RAM, running macOS 15.4.1. Both tools used a 100 × 30 terminal, 300 ms interface refresh, the parallax theme, and disabled mouse input. ptop ran normally, without --vtop-parity or --fix; vtop used Node.js 24.20.0. Run order alternated between vtop/ptop and ptop/vtop, with fresh configuration each time. Existing desktop applications remained running. I paused this session's builds and tests during measurement; other background activity was not controlled.

100% CPU means one fully occupied core. CPU includes startup, shutdown, and sensor children reaped by each monitor. Own-process RSS measures the monitor itself, excluding those children; the table summarizes each run's average RSS. Terminal-emulator rendering is not included.

The improvement comes from the native executable and how it collects data. ptop reads macOS memory data directly where permitted and uses Apple's ps for protected processes, with a complete original scan as the fallback. Memory collection still runs every 200 ms and process collection every two seconds. The familiar screen and controls remain the goal, with the compatibility checks described above.

This is one local macOS workload, not a guarantee for every machine or a Linux performance result. It compares ptop with vtop; it does not establish a new ranking against htop or btop. The four-tool article keeps that earlier experiment separate.

Download the results or reproduce the comparison

The raw measurements include every run, executable hashes, configuration, and a completion record. The benchmark adapter reuses the repository's PTY and resource-measurement code. The vtop installed-file manifest fingerprints the dependencies I tested; it is not an npm lockfile that can reinstall that exact dependency tree.

On an Apple Silicon Mac running macOS 15 or later, with Python 3.11 or newer and Node.js available:

npm install -g @patebryant/ptop@0.1.3 vtop@0.6.1
git clone https://github.com/patebry/ptop.git
cd ptop
git checkout e4c4067e3a862646c93c59152cda5e8fc3b72d0e
curl -fsSLo benchmark-ptop-vtop-default.py https://www.patebryant.com/benchmarks/benchmark-ptop-vtop-default.py
python3 benchmark-ptop-vtop-default.py \
  --harness-dir scripts \
  --ptop "$(command -v ptop)" \
  --vtop "$(command -v vtop)" \
  --node "$(command -v node)" \
  --dependency-lock-out vtop-installed-files.json \
  --seconds 30 --pairs 4 > ptop-vtop.jsonl

The run takes about four minutes. Check that it exits successfully and ends with a completion record before using the results. The harness discards terminal contents and does not save your process list. Earlier experiments and collector implementation details remain in the repository's benchmark history.

Same dots, familiar controls

Use j and k to move through processes, c to sort by CPU, and m to sort by memory. Mouse selection and scrolling work too. To change the look:

ptop -t nord

All 12 themes ship with the binary. The README has the full control list, build instructions, and compatibility notes.

ptop is MIT licensed, with credits and notices for vtop and the projects it builds on. vtop deserves the credit for the interface. I just wanted my own Rust version with a smaller footprint. And apparently an excuse to make a ridiculous launch commercial.

Install ptop from npm or read the source on GitHub. If you find a behavior that doesn't match vtop, open an issue with your terminal size, theme, platform, and reproduction steps.