name amadaluzia/rosetta-collatz
description Rosetta Code Project for the Collatz conjecture
last change 2026-07-26
clone url
https://srcdump.net/amadaluzia/rosetta-collatz.git

commit briefs

ca095f7
Artur Manuel  ·  2026-07-26
master
5daa970
Artur Manuel  ·  2026-07-21
e727915
Artur Manuel  ·  2026-07-21
1b78732
Artur Manuel  ·  2026-07-21
94f2e5f
Artur Manuel  ·  2026-05-24
caf46e3
Artur Manuel  ·  2026-05-20
65df630
Artur Manuel  ·  2026-03-21
c1b49c7
Artur Manuel  ·  2026-03-21
4ebbf90
Artur Manuel  ·  2026-03-21
4304a5c
Artur Manuel  ·  2025-12-27
e3ec80d
Artur Manuel  ·  2025-12-21

branches

refs

tree

readme

Preamble

This is my attempt at a Rosetta Code project using the Collatz conjecture. None of this mischeif should be used as a benchmark to see how fast a language is as it is almost always one-sided towards the best language I write in. It would take different approaches in other languages which may or may not be slower or faster in a certain language.

Story

I wanted to learn how ArrayList works in Zig and how fast it would be. It took around one second to generate 10,000 Collatz sequences on my hardware and I was initially reasonably stumped. I ended up optimising it after some tweaks to use a FixedBufferStream which improved it by ~900ms. I then wrote it in Rust and C++ for testing, with Rust being slower which was unusual to the person I was talking to. I then decided to make to try other languages to see how much more confusing it would be.

Haskell beating C++ and Zig was insane to me but I realised they we're probably my fault so I treated it not like a benchmark.