(defn sum [numbers]
(reduce + numbers))
(def numbers (into [] (range 0 100000000)))
(time (sum numbers))
The above was the code that was ran.
Simply adding up a lot of numbers.
This line was executed in the repl multiple times:
(time (sum numbers))
Each time it almost gets all cores fully running.
Looking at jvisualvm, there were not a lot of threads created.
But this code used all 12 of the hyperthreads that were available on my 6 core laptop.
What was happening behind the scene that made this possible?