Skip to content

Commit

Permalink
Moved profvis stuff to "performance" slides
Browse files Browse the repository at this point in the history
  • Loading branch information
mthomas-ketchbrook committed Sep 17, 2023
1 parent 56e167f commit 0cea143
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 84 deletions.
File renamed without changes
23 changes: 16 additions & 7 deletions materials/d1-03-performance/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "Performance"
subtitle: "posit::conf(2023) <br> Shiny in Production: Tools & Techniques"
author: "TBD"
footer: "[{{< var workshop_short_url >}}]({{< var workshop_full_url >}})"
format:
format:
revealjs:
theme: [default, ../slides.scss] # moon= teal bg | dark
scrollable: true
Expand All @@ -14,8 +14,6 @@ format:
history: false
---

## More to Come

## What is {profvis}?

R package for visualizing how (and how fast/slow) your R code runs
Expand All @@ -26,14 +24,14 @@ R package for visualizing how (and how fast/slow) your R code runs

::: {.notes}
* The package is from Posit
* Help you understand the bottlenecks in your R code
* and, you guessed it, it works with Shiny too
:::

## Working with {profvis} & {golem} {auto-animate=true}

Our `dev/run_dev.R` script is where we can profile our app interactively.

We can modify the original code...

```{.r}
options(golem.app.prod = FALSE)
Expand All @@ -43,10 +41,9 @@ golem::document_and_reload()
run_app()
```

## Working with {profvis} & {golem} {auto-animate=true}

and wrap `run_app()` in `print()`, then `profvis()`...
Our `dev/run_dev.R` script is where we can profile our app interactively.

```{.r}
options(golem.app.prod = FALSE)
Expand All @@ -63,3 +60,15 @@ profvis::profvis({
::: {.notes}
You need to wrap the `run_app()` function in `print()`, before passing it to `profvis::profvis()`
:::

## Demo!

![](assets/img/myspace_meme.png)

::: {.notes}
- Show how to change the `dev/run_dev.R` script to enable {profvis} profiling
- Launch the app, navigate to the "Overview" page, and change a filter
- Stop the app, and wait for the report to load
- Describe the flamegraph, change the filters to only show events that took time
- Navigate to the 'data' tab and discuss what took the most time
:::
77 changes: 0 additions & 77 deletions materials/profvis/index.qmd

This file was deleted.

Binary file removed materials/profvis/www/example_profvis_report.png
Binary file not shown.

0 comments on commit 0cea143

Please sign in to comment.