Skip to main content
CF Bolz-Tereick's Web Page
  • Source
  • Contact
  • Blog
  • Archive
  • RSS feed

Optimizing Collatz in PyPy

CF Bolz-Tereick

2024-06-23 16:26

Source

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:

  • benchmarking
  • pypy
  • python
  • Previous post
  • Next post
Contents © 2025 CF Bolz-Tereick - Powered by Nikola