在尝试获取用户收件箱中最近10个线程的列表时,我遇到了一些主要的性能问题:
threads = gmail_client.users().threads().list(userId='me', maxResults=10, pageToken='', q='-in:chats ', labelIds=['INBOX']).execute()这个查询的持续时间是5-6秒。你知道这是怎么回事吗,或者我怎样才能加快速度?
发布于 2015-03-22 16:59:31
尝试:
threads = gmail_client.users().threads().list(userId='me', maxResults=10, labelIds=['INBOX']).execute()没有理由发送空的pageToken,只需省略属性。另外,聊天消息不在收件箱中,无需在查询中排除它们。
另外,确认性能在邮箱之间是相同的,繁忙的邮箱预计会慢一些。
https://stackoverflow.com/questions/29195691
复制相似问题