---
layout: post
title: "Using R's profvis package to diagnose and resolve bottlenecks (CC286)"
blurb: "Profiling R code with profvis"
author: "PD Schloss"
date: 2024-05-27 11:00
comments: false
youtube: 8Ci8B1GH0Qo
start_hash: cba9943928b7b81b793981435b9ccbe89724c17a
end_hash: 010f74ea8bb82833b7836dde8ee98de8d6e5a1b8
---

Is your R code running slow? Do you know the slowest part? Here, Pat uses the R profvis package to identify the slow points or bottlenecks in his R code. He then uses his test driven design platform written with testthat to optimize the performance the code. Calculating log likelihoods and using the Rfast R package also appear in the refactoring effor. This episode is part of an ongoing effort to develop an R package that implements the naive Bayesian classifier.

<iframe style="margin: 0 auto;display:block;" width="560" height="315" src="https://www.youtube.com/embed/{{ page.youtube }}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

## Code

You can browse the state of the repository at the

* [beginning of the episode](https://github.com/riffomonas/phylotypr/tree/{{page.start_hash}})
* [end of the episode](https://github.com/riffomonas/phylotyprr/tree/{{page.end_hash}})
