-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47f36ca
commit b09ea10
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
Project Path: {{ absolute_code_path }} | ||
|
||
Source Tree: | ||
``` | ||
{{ source_tree }} | ||
``` | ||
|
||
{{#each files}} | ||
{{#if code}} | ||
`{{path}}`: | ||
|
||
{{code}} | ||
|
||
{{/if}} | ||
{{/each}} | ||
|
||
I'd like your help improving the performance of my code. It works correctly, but I need it to be faster and more efficient. | ||
|
||
When looking for optimization opportunities, consider: | ||
- Algorithm complexity and big O analysis | ||
- Expensive operations like disk/network I/O | ||
- Unnecessary iterations or computations | ||
- Repeated calculations of the same value | ||
- Inefficient data structures or data types | ||
- Opportunities to cache or memoize results | ||
- Parallelization with threads/async | ||
- More efficient built-in functions or libraries | ||
- Query or code paths that can be short-circuited | ||
- Reducing memory allocations and copying | ||
- Compiler or interpreter optimizations to leverage | ||
|
||
For each potential improvement, provide: | ||
1. File path and line number(s) | ||
2. Description of the issue/inefficiency | ||
3. Estimated impact on performance | ||
4. Specific suggestions for optimization | ||
|
||
Then update the code with your changes. Be sure to maintain readability and organization. Minor optimizations that significantly reduce clarity are not worth it. | ||
|
||
Add benchmarks if possible to quantify the performance improvements. Document any new usage constraints (e.g. increased memory requirements). | ||
|
||
Try to prioritize the changes that will have the largest impact on typical usage scenarios based on your understanding of the codebase. If the existing code is already well optimized then let me know and explain why it is well optimized. |