From 12a4f8e2415a767c501898d3626663f78fb3c33d Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Tue, 5 Aug 2025 10:37:58 +0200 Subject: Add benchmarks for Ruby, Python and Clojure Ruby is about the same speed as slets. Clojure (babashka) and Python are goddamn fast. Python is 10 times as fast. Clojure is twice as slow as Python but that still outperforms Ruby and slsets. --- benchmarks/benchmark.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 benchmarks/benchmark.py (limited to 'benchmarks/benchmark.py') diff --git a/benchmarks/benchmark.py b/benchmarks/benchmark.py new file mode 100644 index 0000000..eae0e7c --- /dev/null +++ b/benchmarks/benchmark.py @@ -0,0 +1,10 @@ +import sys + +size = int(sys.argv[1]) + +myset1 = {f"x{i*1000}" for i in range(0, size)} +myset2 = {f"x{i*1000+1}" for i in range(0, size)} + +res = None +for i in range(0, 10000): + res = myset1 - myset2 -- cgit v1.2.3