rstudio / pins-r

Pin, discover, and share resources
https://pins.rstudio.com
Other
312 stars 63 forks source link

Reconsider `print` method details #714

Closed juliasilge closed 1 year ago

juliasilge commented 1 year ago

The print method for a board involves calling pin_list():

https://github.com/rstudio/pins-r/blob/61ff6fd4a975f9ff8c3ce761c7d24bd1a773d60b/R/board.R#L69

The results look like:

library(pins)
board_connect()
#> Connecting to Posit Connect 2023.01.0 at <https://colorado.posit.co/rsc>
#> Pin board <pins_board_connect>
#> Cache size: 114K
#> Pins [130]: 'katie.masiello/user-info', 'katie.masiello/content_list',
#>   'julia.silge/cat-tracking-uk', 'katie.masiello/aqi_readings',
#>   'katie.masiello/aqi_exceeding_stations',
#>   'sam.edwardes/bike-predict-r-station-info-pin',
#>   'katie.masiello/codenames', 'katie.masiello/logs',
#>   'kelly.obriant/python-pin-test', 'julia.silge/housing-metrics',
#>   'sam.edwardes/bike-predict-model-metrics',
#>   'sam.edwardes/bike_predict_model_r',
#>   'julia.silge/traffic-crash-model-metrics',
#>   'julia.silge/superbowl-rf-test-2', 'julia.silge/cars-keras',
#>   'michael.chow/mtcars3', 'julia.silge/home-prices',
#>   'julia.silge/new_metrics', 'julia.silge/single-tag-numbers', '...'

Created on 2023-02-15 with reprex v2.0.2

I notice that this can feel S L O W on our demo server. Is it helpful to show these pins? Do folks really expect this? I don't know that there is a useful way to make this faster other than just removing the list.

kmasiello commented 1 year ago

I concur -- but it doesn't feel slow, it IS slow! I'm an admin on that server, so I have visibility of significantly more records. It takes over 30 seconds to render:

library(pins)
start <- Sys.time()
board_connect()
#> Connecting to Posit Connect 2023.01.0 at <https://colorado.posit.co/rsc>
#> Pin board <pins_board_connect>
#> Cache size: 619K
#> Pins [843]: 'katie.masiello/aqi_readings',
#>   'katie.masiello/aqi_exceeding_stations',
#>   'pritam.dalal/bitcoin_intraday', 'thomas/boston-weather',
#>   'sam.edwardes/bike-predict-r-station-info-pin',
#>   'katie.masiello/codenames', 'katie.masiello/logs',
#>   'katie.masiello/nonshiny_raw_usage',
#>   'katie.masiello/shiny_raw_usage', 'pritam.dalal/soybean_yields_pin',
#>   'katie.masiello/group_members_tbl', 'katie.masiello/group_names_tbl',
#>   'lisa.anders/cars_dataset', 'roger.andre/new_faithful_data',
#>   'katie.masiello/katietestpin', 'katie.masiello/user-info',
#>   'katie.masiello/content_list', 'julia.silge/cat-tracking-uk',
#>   'kelly.obriant/python-pin-test', '...'
message(paste("Duration =", Sys.time()-start, "seconds"))
#> Duration = 32.7105123996735 seconds

Created on 2023-02-16 by the reprex package (v2.0.1)

Having used pins extensively, I have never had a use case for calling board_connect() without assigning it to a variable (and thus avoiding this pain). It has only been by accident that I have directly invoked this function and learned quickly that it should be avoided. There's no value to the pin_list() output in this scenario.

Sentiment also seconded by a Posit Connect customer during a call today.

github-actions[bot] commented 1 year ago

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.