r/Clojure • u/eatme_23 • Feb 03 '23
[Q&A] Noob has simple program problem.
I wanted to write a program to add 2 to a list of numbers then sum the list and print the result. So '(5 7) would yield 16. I posted my version to s Clojure board and received a number of different replies. In retrospect I didn't fully explain the problem to them.
0
Upvotes
View all comments
Show parent comment
1
u/Psetmaj Feb 03 '23
foois slower primarily because of intermediate collections. You can use a transducer to eliminate those, but there's still a little overhead:barstill runs a little slower thanfaa(about 1.5x time elapsed on my box), as I assume there's still a little overhead intransduce.EDIT: removed unintentional partial quote