Use the prompt
Include measured resource use and the target device's constraints. An optimization that saves memory may change timing or power use, so compare the result on the device's actual workload.
Optimize code for memory-constrained embedded devices. Balance performance and power consumption.
For GitLab Duo
Optimize this embedded code for [DEVICE/CONSTRAINTS]:
[PASTE CODE]
Constraints:
- Memory: [SIZE]
- CPU: [SPECS]
- Power: [REQUIREMENTS]
Optimize for:
1. Memory footprint
2. Execution speed
3. Power consumption
4. Code size
5. Maintain functionalityInclude measured resource use and the target device's constraints. An optimization that saves memory may change timing or power use, so compare the result on the device's actual workload.