Super slow
See original GitHub issueThis Script takes almost 20 minutes to parse through 186 rows.
bufsize = 1
with open('/cygdrive/c/hsmtest_adep/final_batch.sh', 'w', bufsize) as f:
for row in range(3, 186):
sentry = ''
counter = 0
while not sentry and counter < 3:
try:
gc = gspread.login('xxxxx', 'xxxxx') # If i do this outside the loop i see intermittent failures
sht = gc.open_by_key('xxxx')
worksheet = sht.worksheet("xxxxxx")
values_list = worksheet.row_values(row)
sentry = True;
except:
print("Row:", row, "Got Worksheet Error, Trying Again...")
counter += 1
try:
print("./test_alias.sh -a", values_list[2])
if values_list[2]:
values = "./test_alias.sh -a " + values_list[2] + "\n"
string = str(values)
f.write(string)
except IndexError:
print("No Cert Alias for row id:", row)
f.close()
Issue Analytics
- State:
- Created 9 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Super Slow - Wikipedia
Super Slow is a form of strengthening physical exercise (resistance training) popularized by Ken Hutchins. Super Slow is Hutchins' trademarked name for the ......
Read more >Super-Slow Weight Training Increases Strength - WebMD
Want More Strength? Slow It Down. A super-slow weight-training program can dramatically improve strength, users say, and the workout is intense.
Read more >Super Slow: The Ultimate Exercise Protocol - Amazon.com
2. On Super Slow, you should be using about as much resistance as you use on a traditional strength training workout. A traditional...
Read more >Super Slow Resistance Training
Superslow training, originated in 1982 by Ken Hutchins, was developed in an osteoporosis study with older women because of the need to utilize...
Read more >SuperSlow Zone: Premier Wellness
Proven Technology to reverse, stabilize, or slow the degrading of bones. Healthy Eating / Weight Loss. Combine SSZ Healthy Eating and Personal Strength...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Google Spreadsheets API can be pretty slow depending on many factors including your connection speed to Google servers, usage of proxy, etc. In your code snippet I can see
gspread.logininside a loop. Please consider pulling this out of the loop because this method is slow. Having failures while connecting to Google API is another matter for creating an issue on GitHub.Note: please pay attention to the formatting of the Python code you’ve posted. It is unreadable without proper usage of whitespace. Check GitHub manual on how to use Markdown in comments and issues.
@samuelcolvin Interestingly, I’ve just checked the API reference, and I couldn’t find any trace of range parameter in the docs anymore. However the test suite runs just fine.
I’ve debugged the
rangemethod to check the data in the server’s response, and for a requested range A1:B5 there was exactly 10 entries in the XML feed:I think the
rangeis working correctly, and the returned data is less than in the case of returning the entire sheet. My guess is that in your case it’s not the amount of data responsible for the timing of therangebut the fact that there’s a creation of aCellobject for every cell in the range. I’ll try to profile the code to see the real reason. Thank you for noting this!