Skip to content

Commit c8c4e03

Browse files
committed
Add performance guidelines for animation frame code
Added recommendations to reduce object and function creation within methods, prefer module-scoped variable caching, and use native loops instead of function-based iterators for code running on requestAnimationFrame.
1 parent d3b4374 commit c8c4e03

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ Designed for modern browsers with ES6+ support. Uses feature detection for rende
123123
- Use JSDoc comments for public API methods
124124
- Use 2-space indentation for JavaScript files
125125
- Place new components in appropriate src/ subdirectories
126+
- Application runs lots of functions on requestAnimationFrame (or per animation frame) so:
127+
- Reduce the amount of objects and functions created within methods
128+
- Prefer caching variables to the module scope
129+
- Do not use function based iterators (prefer native for loops, etc.)
126130

127131
## Architecture Patterns
128132

0 commit comments

Comments
 (0)