MCPcopy Index your code
hub / github.com/TheoTheDev/three-perf

github.com/TheoTheDev/three-perf @v1.0.11

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.11 ↗ · + Follow
59 symbols 109 edges 13 files 4 documented · 7% updated 13mo agov1.0.11 · 2025-06-09★ 623 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

three-perf

Changelog

Easily monitor the performances of your vanilla threeJS application.

Add the ThreePerf component anywhere in your Canvas [example]. Screenshot 2023-07-19 at 15 59 45

Installation

npm install three-perf --save-dev

Options

logsPerSecond?: number // Refresh rate of the logs [default 10]
renderer: THREE.WebGLRenderer // renderer you want to debug
domElement: HTMLElement // dom element to which stats block will be attached to
showGraph?: boolean // toggles cpu/gpu/fps graphs rendering
memory?: boolean // toggles memory info visiblity [like geos / textures / shaders etc count]
enabled?: boolean // toggles stats harvesting
visible?: boolean // stats are harvested, but stats panel is hidden
actionToCallUI?: string // by default is disabled [''], but if set and type this text in the tab window three-perf dev gui will be shown
guiVisible?: boolean, // default three-perf dev gui visiblity [falde by default]
backgroundOpacity?: number // stats block background opacity level [0.7 by default]
scale?: 1 // stats block scale [default 1]
anchorX?: 'left' | 'right' // default is left [stats container horrisontal anchor]
anchorY?: 'top' | 'bottom' // default is top [stats container vertical anchor]

Usage

import { ThreePerf } from 'three-perf'

const perf = new ThreePerf({
    anchorX: 'left',
    anchorY: 'top',
    domElement: document.body, // or other canvas rendering wrapper
    renderer: renderer // three js renderer instance you use for rendering
});

function () {

    perf.begin();

    // supports composer or multy-pass rendering
    renderer.render( scene, camera );

    perf.end();

}

Maintainers :

Thanks

To twitter @utsuboco [this is port from r3f/pref to vanilla]

Extension points exported contracts — how you extend this code

Window (Interface)
(no doc)
src/GLPerf.ts
IThreePerfProps (Interface)
(no doc)
src/ThreePerf.ts
IDrawCount (Interface)
(no doc)
src/helpers/Types.ts
Performance (Interface)
(no doc)
src/GLPerf.ts
ILogsAccums (Interface)
(no doc)
src/helpers/Types.ts

Core symbols most depended-on inside this repo

render
called by 6
src/ui/UI.ts
average
called by 5
src/GLPerf.ts
update
called by 3
src/ui/UI.ts
end
called by 2
src/GLPerf.ts
updateAccums
called by 2
src/GLPerf.ts
render
called by 2
demo/src/entry-client.js
initGpu
called by 1
src/GLPerf.ts
is120hz
called by 1
src/GLPerf.ts

Shape

Method 36
Function 10
Class 8
Interface 5

Languages

TypeScript100%

Modules by API surface

src/ThreePerf.ts17 symbols
src/GLPerf.ts15 symbols
src/ui/UI.ts14 symbols
src/helpers/Utils.ts3 symbols
demo/src/entry-client.js3 symbols
src/types.d.ts2 symbols
src/helpers/Types.ts2 symbols
src/helpers/EstimateBytesUsed.ts1 symbols
src/helpers/CountGeoDrawCalls.ts1 symbols
demo/server.mjs1 symbols

For agents

$ claude mcp add three-perf \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact