I recently ran a workshop on writing performant R code you can find the slides at Performant R.
I took a very wide overview of the subject covering profiling and benchmarking, vectorising, parallelism, Rcpp, and working with larger than memory datasets as well as caching of computationally results with compressed data object outputs and pipeline managment tools. There are links to further reading/watching in the presenter notes and the gitlab repo.
[UPDATE 2022-11-12] I ran an extended version of this workshop at the Babraham institute and migrated the code to Renku so that you can spin up an R environment to follow along with the exercises in the cloud of in a local container see the Renku project page.
:::