Hacker News new | past | comments | ask | show | jobs | submit login

R in general and especially loops are slow; slower than even Python. Making a function and applying it on a vector is a simple way to boost performance. Also recursion seems[1] to be faster than iteration.

Seeing the code in article, it can be that a part in that speedup is because R is used and not only of a better algorithm.

[1]: https://predictivehacks.com/a-comparison-between-iteration-r...




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: