Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f5e2742
feat: add auto-performance profiling system
CripterHack Oct 24, 2025
39a6c5f
feat: integrate auto-performance profiling with GPUComposer
CripterHack Oct 24, 2025
b3ac11e
fix: resolve pre-existing TypeScript build errors
CripterHack Oct 24, 2025
b733cbb
build: update distribution files after TypeScript error fixes
CripterHack Oct 24, 2025
1eb4595
fix: update TypeScript lib configuration to es2020
CripterHack Oct 24, 2025
89b9721
docs(performance): add auto-performance profiling documentation
CripterHack Oct 25, 2025
50fa639
feat: add adaptive performance system core
CripterHack Oct 25, 2025
94c0230
feat: integrate adaptive performance system with GPUComposer
CripterHack Oct 25, 2025
edc4b6d
build: update dist files with performance system integration
CripterHack Oct 25, 2025
7c46b92
docs: update API documentation for performance system
CripterHack Oct 25, 2025
a40b38e
test: fix testing infrastructure and ensure compatibility
CripterHack Oct 25, 2025
c6267df
chore: update package dependencies and lock file
CripterHack Oct 25, 2025
ca24076
feat: implement performance auto-profile system
CripterHack Oct 25, 2025
22b0b98
test: add comprehensive performance auto-profile tests
CripterHack Oct 25, 2025
0dfecb7
feat: add interactive auto-performance example
CripterHack Oct 25, 2025
97c01fd
docs: update API documentation for performance auto-profile
CripterHack Oct 25, 2025
c0e57ac
docs: add performance auto-tuning section to README
CripterHack Oct 25, 2025
e36bb18
build: update distribution files with performance auto-profile
CripterHack Oct 25, 2025
d7f36cc
fix: stabilize UI and RAF loop, correct absolute paths, guard Tweakpa…
CripterHack Oct 26, 2025
8556011
docs(auto-profile): update and expand auto-performance documentation
CripterHack Oct 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,84 @@ loop(); // Start animation loop.
[Demo this code](https://apps.amandaghassaei.com/gpu-io/examples/demo/) - You should see the noise slowly blur, refresh the page to start it over.


## Performance Auto-Tuning

gpu-io includes automatic performance profiling that dynamically adjusts quality settings based on your device's capabilities and runtime performance. This helps ensure smooth performance across a wide range of devices, from high-end desktops to mobile phones.

### Enabling Auto-Performance

To enable automatic performance tuning, pass the `autoPerformanceProfile` option when creating a GPUComposer:

```js
import { GPUComposer } from 'gpu-io';

const composer = new GPUComposer({
canvas: document.getElementById('webgl-canvas'),
autoPerformanceProfile: true, // Enable with default settings
});

// Or with custom options:
const composer = new GPUComposer({
canvas: document.getElementById('webgl-canvas'),
autoPerformanceProfile: {
profileId: 'medium', // Start with specific quality preset
debugLogging: true, // Enable performance debug logs
onPerformanceUpdate: (metrics) => {
console.log('FPS:', metrics.fps);
},
},
});
```

### Quality Presets

The auto-performance system uses four quality presets:

- **High**: Best visual quality, highest performance requirements
- **Medium**: Balanced quality and performance
- **Low**: Reduced quality for better performance
- **Minimal**: Lowest quality, best performance on low-end devices

### Manual Quality Control

You can also manually control quality presets:

```js
// Set a specific quality preset
composer.setQualityPreset('low');

// Get current quality preset
const currentPreset = composer.getCurrentQualityPreset();

// Reset to auto-detected quality
composer.resetPerformanceConfig();
```

### Opting Out

If you prefer to manage performance manually, simply don't include the `autoPerformanceProfile` option:

```js
const composer = new GPUComposer({
canvas: document.getElementById('webgl-canvas'),
// No autoPerformanceProfile - manual control
});
```

### Troubleshooting for Reduced-Motion Users

If you have `prefers-reduced-motion` enabled in your system settings, the auto-performance system will automatically select the lowest quality preset (`minimal`) to respect your accessibility preferences. To override this behavior, you can manually set a specific quality preset:

```js
const composer = new GPUComposer({
canvas: document.getElementById('webgl-canvas'),
autoPerformanceProfile: {
profileId: 'medium', // Override reduced-motion detection
},
});
```


## Examples

Check out the [Examples page](https://apps.amandaghassaei.com/gpu-io/examples/) to really understand how gpu-io works and how to easily create touch interactions in your application.
Expand Down
Loading