diff --git a/materials/profvis/www/myspace_meme.png b/materials/d1-03-performance/assets/img/myspace_meme.png similarity index 100% rename from materials/profvis/www/myspace_meme.png rename to materials/d1-03-performance/assets/img/myspace_meme.png diff --git a/materials/d1-03-performance/index.qmd b/materials/d1-03-performance/index.qmd index fd94dae..994f4f0 100644 --- a/materials/d1-03-performance/index.qmd +++ b/materials/d1-03-performance/index.qmd @@ -3,7 +3,7 @@ title: "Performance" subtitle: "posit::conf(2023)
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 @@ -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 @@ -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) @@ -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) @@ -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 +::: diff --git a/materials/profvis/index.qmd b/materials/profvis/index.qmd deleted file mode 100644 index 900b9a4..0000000 --- a/materials/profvis/index.qmd +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: "Improving Performance by Profiling Your R Code" -subtitle: "posit::conf(2023)
Shiny in Production: Tools & Techniques" -author: "Michael Thomas" -footer: "[shinyprod.com](https://shinyprod.com)" -format: - revealjs: - # theme: [default, ../slides.scss] # moon= teal bg | dark - scrollable: true - incremental: true - slide-number: c/t # c/t | c | h/v | h.v - slide-tone: false #true - code-line-numbers: false - history: false - #title-slide-attributes: - #data-background-image: assets/img/bg/vincentiu-solomon-ln5drpv_ImI-unsplash.jpg - ---- - -## What is {profvis}? - -R package for visualizing how (and how fast/slow) your R code runs - -[{profvis} website](https://rstudio.github.io/profvis/index.html) - -![](www/example_profvis_report.png) - -::: {.notes} -* The package is from RStudio -* 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. - -```{.r} -options(golem.app.prod = FALSE) - -golem::detach_all_attached() - -golem::document_and_reload() - -run_app() -``` -## Working with {profvis} & {golem} {auto-animate=true} - -Our `dev/run_dev.R` script is where we can profile our app interactively. - -```{.r} -options(golem.app.prod = FALSE) - -golem::detach_all_attached() - -golem::document_and_reload() - -profvis::profvis({ - print(run_app()) -}) -``` - -::: {.notes} -You need to wrap the `run_app()` function in `print()`, before passing it to `profvis::profvis()` -::: - -## Demo! - -![](www/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 -::: \ No newline at end of file diff --git a/materials/profvis/www/example_profvis_report.png b/materials/profvis/www/example_profvis_report.png deleted file mode 100644 index 890d771..0000000 Binary files a/materials/profvis/www/example_profvis_report.png and /dev/null differ