Boosting Performance by Adjusting GC Thresholds

Tuning Python's GC thresholds can significantly boost performance. For instance, increasing the Generation 0 allocation threshold (`threshold0`) from its default 700 to 50,000, often combined with `gc.freeze()`, resulted in a 20% faster response time for Talk Python and improved p95 latency by 80-100ms for Close.com, by reducing frequent collection pauses.

Sources

Open the full topic