docs(python): add GCI91 feasibility report and green metrics#459
docs(python): add GCI91 feasibility report and green metrics#459harag7810 wants to merge 1 commit into
Conversation
|
|
||
| When the sorting node is identified as an input directly feeding a filter constraint, the rule engine can easily raise a violation issue recommending a structural inversion (filtering first, then sorting). | ||
|
|
||
| == 3. Benchmark and Technical Protocol |
There was a problem hiding this comment.
Hi @harag7810 could you give us more details on context of your local tests, and some image captures, the software used for example ?
could you write a documentation with the same template of the other rules ? ofr example, give us a non compliant code and a compliant code block.
There was a problem hiding this comment.
Pull request overview
Adds a Python-specific feasibility/benchmark report for rule GCI91 (“Use filter feature before sort elements”) to support moving the rule from “pending” toward “active/applicable” in the Python eco-design standard documentation set.
Changes:
- Added an AsciiDoc feasibility and optimization report for GCI91 (Python) with benchmark protocol and results.
- Documented performance, memory, and CodeCarbon-based energy/carbon measurements for “sort-then-filter” vs “filter-then-sort”.
- Included an explicit recommendation to activate/apply the rule for Python based on observed deltas.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| == 6. Recommendation | ||
| Based on clear empirical evidence tracking hardware power consumption, implementing GCI91 delivers substantial infrastructure relief and carbon reduction without adding syntax complexity. We recommend shifting the rule state to applicable for Python. |
|
@harag7810 , |
|
Hi @harag7810 , I was waiting for you to take into accounts review feebacks, but for lack of your answer, I decided to recteate a new PR from yours. thus I close yours. thank you again |
Context:
Rule GCI91 (Use filter feature before sort elements) was currently pending analysis for Python in the RULES.md file.
Our team (Les Buzz du decollage permanent) conducted a comprehensive benchmark using CodeCarbon to measure execution time, peak RAM allocation, and real hardware energy consumption (CPU and RAM) to validate if this rule delivers a concrete ecological value for the Python eco-design standard.
Test Protocol:
We compared sorting a complete dataset before filtering vs filtering the dataset first and sorting the remaining elements (keeping ~10% of the data).
The tests were run over 10 sequential iterations with the Python Garbage Collector disabled to measure raw, unbiased hardware consumption.
Benchmark Results:
CPU Energy : 0.000000 kWh
RAM Energy : 0.000009 kWh
Emissions : 0.5258 mg CO2
CPU Energy : 0.000000 kWh
RAM Energy : 0.000002 kWh
Emissions : 0.0979 mg CO2
Analysis & Conclusion:
The results perfectly validate the algorithmic theory. By filtering the dataset first, we dramatically reduce the 'n' parameter for Python's Timsort algorithm, which operates in O(n log n). This directly slashes CPU computation time and drastically lowers the peak RAM needed to hold the sorted array structures.
CodeCarbon metrics show a hardware energy footprint divided by more than 5, proving a massive ecological value.
Required Action:
A new feasibility report has been added to src/main/rules/GCI91/python/. We recommend updating the rule matrix state to applicable (active) for Python.