<!--
.. title: Optimizing Collatz in PyPy
.. slug: collatz-in-pypy
.. date: 2024-06-23 16:26:28 UTC+02:00
.. tags: python, pypy, benchmarking
.. category: 
.. link: 
.. description: 
.. type: text
-->

Somebody was Wrong on the Internet about the performance of Python, using
computing Collatz sequence as a benchmark. Therefore I had to try to measure
how long this takes on PyPy, with and without adding a cache for already seen
numbers. Takes about 4min on my laptop for 1 billion numbers, or 30s with a
cache. Code is here:

<script src="https://gist.github.com/cfbolz/4bfa8e3f6be4b825e2252887fe7a78c4.js"></script>
