jennybc / googlesheets

Google Spreadsheets R API
Other
783 stars 191 forks source link

gs_new() and gs_ws_new() too slow #360

Closed ankhnesmerira closed 2 years ago

ankhnesmerira commented 6 years ago

As of 2022-02-03, the googlesheets package has been archived on CRAN. I'm closing all issues and pull requests prior to archiving this GitHub repo.

Learn more at:

https://github.com/jennybc/googlesheets#readme

jennybc commented 6 years ago

Wow! Working with Google Sheets via API is not performant but what you're describing is very unusual.

Here's what I just got with gs_new():

> system.time(iris_ss <- gs_new("iris", input = head(iris, 3), trim = TRUE))
Sheet "iris" created in Google Drive.
Range affected by the update: "R1C1:R4C5"
Worksheet "Sheet1" successfully updated with 20 new value(s).
Accessing worksheet titled 'Sheet1'.
Sheet successfully identified: "iris"
Accessing worksheet titled 'Sheet1'.
Worksheet "Sheet1" dimensions changed to 4 x 5.
Worksheet dimensions: 4 x 5.
   user  system elapsed 
  0.919   0.034  10.670 

I have never written a data.table this way but also don't see why that would affect things. If you write a plain vanilla data frame, do you see a difference?

ankhnesmerira commented 6 years ago

Hi, thanks for your response. I've tried with plain data.frame and it's the same issue. I've put the question online as well and it seems there are other people who are experiencing the same slow performance.

thanks

tomwwagstaff-product commented 6 years ago

I am experiencing the same issue with gs_ws_new() - writing datasets of modest size (a few columns, a few hundred rows) is taking perhaps 10 minutes...

However, this only seems to be a problem when I'm uploading dplyr tibbles - I can upload a vanilla dataframe very snappily.

P.S. love the googlesheets package - it's making my life so much easier - thank you :-)

jennybc commented 6 years ago

Hmm ... interesting re: tibble vs. data frame. In any case, the reboot googlesheets4 is well underway, with reading public Sheets already available for use. Writing will come soon!

What I'm saying: I will not be troubleshooting this any further here and, I hope, it will simply not be a problem in googlesheets4, with the new API.

mlamias commented 5 years ago

I too am having this problem, but I'm using a plain-old non-dplyr'ed data frame that is 3038 x 26 (not exactly massive. I'm hoping there's a resolution soon! Love the package!

hiteshahuja29 commented 5 years ago

Hey Jenny, can we please have an update on the new googlesheets package? Waiting eagerly for this. The googlesheets package has a very slow gs_edit function.

jennybc commented 5 years ago

I'm back on this google stuff now. I have to get gargle onto CRAN first (the package providing auth), then googlesheets4. I think it's likely that googlesheets4 will go to CRAN first as read only (sort of it's current form, really), just to get the ball rolling sooner, but YES writing into Sheets from googlesheets4 is a very high priority.

luispitta commented 5 years ago

I am experiencing the same issue with gs_ws_new() - writing datasets of modest size (a few columns, a few hundred rows) is taking perhaps 10 minutes...

However, this only seems to be a problem when I'm uploading dplyr tibbles - I can upload a vanilla dataframe very snappily.

P.S. love the googlesheets package - it's making my life so much easier - thank you :-) Hi Tom, what's a Vanilla Data Frame? Can you explain to me? I try with a normal df and its too slow. My DF has 35 columns and 179 rows

tomwwagstaff-product commented 5 years ago

Hi @luispitta, Yeah I just meant a normal dataframe, sorry that's not working for you

luispitta commented 5 years ago

Wow! Working with Google Sheets via API is not performant but what you're describing is very unusual.

Here's what I just got with gs_new():

> system.time(iris_ss <- gs_new("iris", input = head(iris, 3), trim = TRUE))
Sheet "iris" created in Google Drive.
Range affected by the update: "R1C1:R4C5"
Worksheet "Sheet1" successfully updated with 20 new value(s).
Accessing worksheet titled 'Sheet1'.
Sheet successfully identified: "iris"
Accessing worksheet titled 'Sheet1'.
Worksheet "Sheet1" dimensions changed to 4 x 5.
Worksheet dimensions: 4 x 5.
   user  system elapsed 
  0.919   0.034  10.670 

I have never written a data.table this way but also don't see why that would affect things. If you write a plain vanilla data frame, do you see a difference?

Hi Jenny, im trying to create a google sheet with my df, but its really slow and i don't know the reason, i have a tibble with 35 columns and 178 rows.

luispitta commented 5 years ago

Hi Guys, i resolve the problem by reducing the columns in my data frame, i also use the parameters: col_extent = ncol(data_frame), row_extent = nrow(data_frame) Hope it can help you to.