Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .jules/bolt.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
## 2025-05-20 - Pre-compiling Regex in Loops
**Learning:** `re.findall(pattern, string)` recompiles (or retrieves from cache) the pattern on every call. In high-frequency functions called inside loops (like complexity estimation), this overhead adds up.
**Action:** Always pre-compile regexes (`re.compile`) into module-level or class-level constants if they are used repeatedly, especially in tight loops or recursive functions.

## 2025-05-22 - O(N*M) to O(N) Match Loops Lookup
**Learning:** Nested loops checking for `item1.id == item2.id` (such as searching solutions for exercises) become major bottlenecks during bulk processing (O(N*M) complexity).
**Action:** Always refactor these O(N*M) search loops into O(N) hash map lookups by pre-computing a dictionary mapped by the shared key (e.g., `lookup_dict = {item.id: item for item in items}`). When there is a risk of duplicate keys and the original loop used `break` (first match semantics), populate the dictionary manually with `if key not in dict: dict[key] = item`.
1 change: 1 addition & 0 deletions evolutia.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ tests/test_config_validator.py
tests/test_exercise_analyzer.py
tests/test_exercise_analyzer_cache.py
tests/test_json_robustness.py
tests/test_markdown_parser.py
tests/test_math_extractor.py
Loading