npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sireai/perfsight

v0.3.8

Published

Android app CPU, PSS, leak watermark, and HPROF capture watcher over adb.

Readme

PerfSight

PerfSight is a local Android performance watcher for endurance runs. It samples app CPU, total PSS, memory composition, leak signals, heap dumps, and Web UI live state from adb.

Quick Start

Install

npm install -g @sireai/perfsight

Or run without installing:

npx @sireai/perfsight text com.mi.car.mobile

Run

Text mode:

perfsight text com.mi.car.mobile

Web mode:

perfsight web com.mi.car.mobile

Enable leak capture:

perfsight text com.mi.car.mobile --enable-leak-capture
perfsight web com.mi.car.mobile --enable-leak-capture

Start from a clean artifact set for the current package:

perfsight text com.mi.car.mobile --output-dir ./data --reset-output-dir

Show periodic CPU/PSS sample lines in text mode:

perfsight text com.mi.car.mobile --enable-leak-capture --show-samples

When text mode runs in an interactive terminal, press T to start/stop a Perfetto trace, C for a CPU profile, D for a manual HPROF dump, H for status, or Q to stop safely. These controls are disabled for redirected output and CI runs.

Automation Capture

Use one option for unattended artifact capture. Each command waits for a running app process, saves its artifact, then exits:

perfsight text com.example.app --capture memory --output-dir ./artifacts
perfsight text com.example.app --capture cpu --duration 30 --output-dir ./artifacts
perfsight text com.example.app --capture trace --duration 15 --output-dir ./artifacts

memory writes an HPROF and requires a debuggable app or rooted device. cpu uses device simpleperf and verifies availability for the running app with a short probe. trace records a device-native Perfetto app-responsiveness trace. --duration defaults to 30 seconds for CPU and Perfetto captures. --capture is a one-shot operation and cannot be combined with --enable-leak-capture.

APK Artifact Analysis

Analyze a local APK without adb, Android SDK, or Java:

perfsight artifact inspect app-release.apk
perfsight artifact inspect app-release.apk --open
perfsight artifact inspect app-release.apk --mode web
perfsight artifact compare previous.apk current.apk
perfsight artifact compare previous.apk current.apk --open
perfsight artifact compare previous.apk current.apk --mode web

Artifact analysis reports APK composition, largest files, Manifest metadata, permissions, exported components, basic DEX reference counts, and security-focused findings. Compare mode adds file-size, permission, component, and application-attribute changes. Use --open to open the generated report automatically; with --mode web --open, it opens the local Web report. APK is the supported input format in this release.

Common Commands

perfsight --help
perfsight help text
perfsight help web
perfsight help leak-capture
perfsight version
perfsight upgrade

Web mode also starts a local server at:

http://127.0.0.1:8765

Output Layout

PerfSight writes managed artifacts under output-dir with a package-scoped structure:

<output-dir>/
  sessions/<package>/<timestamp>/
    samples.csv
    session.json
    report.html
  captures/<package>/
  simpleperf/<package>/
  perfetto/<package>/
  logs/<package>/
  artifacts/
    inspect/<apk>/
    compare/<previous>__<current>/

--reset-output-dir clears the current package's existing sessions, captures, simpleperf, perfetto, and logs artifacts before a new run.

Text mode is quiet by default and prints startup, capture, dump, error, and exit events. Use --show-samples when you also want each periodic CPU/PSS sample line.

Web UI Features

  • live App CPU chart
  • live Total PSS and composition chart
  • manual Dump Memory
  • manual simpleperf Start Recording / Stop Recording
  • manual Perfetto Start Trace / Stop Trace for app responsiveness timelines, including before the app process starts
  • automatic leak-triggered dump capture
  • reconnect-aware device state

On macOS, PerfSight bundles the simpleperf Gecko conversion runtime used to open CPU recordings in Firefox Profiler. Other hosts fall back to a local Android NDK simpleperf install when available. PerfSight uses the device-provided simpleperf record --app <package> -e task-clock:u -g path first, then falls back to PID-based strategies where needed. This avoids relying on the app's run-as access on user builds. Web mode performs a one-second CPU recording capability probe when the device connects and the target app is running. Probe files are removed from the device and are not exported as recording artifacts. Perfetto uses the device-provided binary and records Android scheduling, CPU frequency, UI, graphics, input, and frame timing. Its global Android trace categories retain cold-start system work such as activity management, Binder, Dalvik, resources, and memory. Active CPU and Perfetto recordings are stopped when PerfSight exits or loses its adb connection; a short device-side lease also stops and cleans abandoned recordings after host loss. Interrupted recordings are not recovered in a later run.

More Docs