cache-property-access-in-loops
CommunityOptimize loop performance
Authorihj04982
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill addresses performance bottlenecks in code by optimizing how object properties are accessed within loops, reducing redundant lookups.
Core Features & Use Cases
- Property Caching: Stores frequently accessed object properties in local variables before a loop begins.
- Performance Improvement: Significantly speeds up code execution in "hot paths" where properties are accessed repeatedly.
- Use Case: Refactor a TypeScript loop that repeatedly accesses
obj.config.settings.valueto first assign this value to a constant, thereby reducing the number of property lookups from N to 1.
Quick Start
Optimize the provided TypeScript code snippet by caching property access within the loop.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: cache-property-access-in-loops Download link: https://github.com/ihj04982/my-cursor-settings/archive/main.zip#cache-property-access-in-loops Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.