Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Easily monitor the performances of your @react-three/fiber application.
Add the Perf component anywhere in your Canvas. |
yarn add --dev r3f-perf
logsPerSecond?: 10, // Refresh rate of the logs
antialias?: true, // Take a bit more performances but render the text with antialiasing
overClock?: false, // Disable the limitation of the monitor refresh rate for the fps
deepAnalyze?: false, // More detailed informations about gl programs
showGraph?: true // show the graphs
minimal?: false // condensed version with the most important informations (gpu/memory/fps/custom data)
customData?: {
value: 0, // initial value,
name: '', // name to show
round: 2, // precision of the float
info: '', // additional information about the data (fps/ms for instance)
}
matrixUpdate?: false // count the number of time matrixWorldUpdate is called per frame
chart?: {
hz: 60, // graphs refresh frequency parameter
length: 120, // number of values shown on the monitor
}
colorBlind?: false // Color blind colors for accessibility
className?: '' // override CSS class
style?: {} // override style
position?: 'top-right'|'top-left'|'bottom-right'|'bottom-left' // quickly set the position, default is top-right
import { Canvas } from '@react-three/fiber'
import { Perf } from 'r3f-perf'
function App() {
return (
<Canvas>
<Perf />
</Canvas>
)
}
import { Canvas } from '@react-three/fiber'
import { PerfHeadless, usePerf } from 'r3f-perf'
const PerfHook = () => {
// getPerf() is also available for non-reactive way
const [gl, log, getReport] = usePerf((s) => s[(s.gl, s.log, s.getReport)])
console.log(gl, log, getReport())
return <PerfHeadless />
}
function App() {
return (
<Canvas>
<PerfHook />
</Canvas>
)
}
import { setCustomData, getCustomData } from 'r3f-perf'
const UpdateCustomData = () => {
// recommended to throttle to 1sec for readability
useFrame(() => {
setCustomData(55 + Math.random() * 5) // will update the panel with the current information
})
return null
}
The tool work with any server side rendering framework. You can try with Next and @react-three/fiber using this starter : https://github.com/pmndrs/react-three-next
7.2.1:
FAQs
Easily monitor your ThreeJS performances.
We found that r3f-perf demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.