Skip to content

Commit a84666d

Browse files
authored
Comparison with Python's Built-in itertools
speed 1.4X or more
1 parent a709197 commit a84666d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ The table below demonstrates the performance of **PositionPure (permPure_full)**
9696

9797
---
9898

99+
### Comparison with Python's Built-in itertools
100+
101+
At the request of Reddit users and other community members, a performance comparison with Python’s built-in `itertools` was conducted. Results are based on the implementation in `Position-Pure-Algorithm/python/pp_iter.py`.
102+
103+
* **Runtime Environment**: The tests were performed using **PyPy3**. Since the standard `itertools` library is C-optimized, using PyPy3 helps bridge the low-level language gap, allowing for a more authentic comparison of algorithmic efficiency.
104+
* **Results**: Benchmark tests show that this algorithm improves performance by at least **1.4x**, with potential gains reaching over **2x** compared to the standard library.
105+
* **Future Plans**: For applications requiring even higher performance, a **C-compiled version** should be considered.
106+
107+
---
108+
99109
#### **Key Insights**
100110
* **Significant Speedup:** `permPure_full` consistently outperforms Heap's Algorithm by a factor of approximately **6x**.
101111
* **High Throughput:** For $n=13$, `permPure_full` processes over **6.2 billion permutations** in under 4 seconds, showcasing exceptional instruction-level efficiency.

0 commit comments

Comments
 (0)