Understanding why a programming language can be slow is a fundamental skill needed to be able to increase the speed of its implementations. Any implementation in any programming language is similarly affected by an algorithm's time and memory complexities, because they are algorithms, and not implementation properties. However, the way languages handle specific implementations can vary quite a bit, and that's what we'll focus on now.
In the case of R, people often find the following four main bottlenecks:
- Object immutability
- Interpreted dynamic typings
- Memory-bound processes
- Single-threaded processes
By no means is this list complete or encountered in every implementation. It's just the most common bottlenecks I've seen people encounter, and which, after being fixed, produced the largest amount of speed improvements. They...