gmailgem / gmail

A Rubyesque interface to Gmail, with all the tools you'll need.
Other
397 stars 119 forks source link

Time to access email content #161

Closed carlinoseldepi closed 9 years ago

carlinoseldepi commented 9 years ago

In this situation:

gmail = Gmail.connect!(my_user_account,my_user_pass)

mails = gmail.inbox.emails(:unread)

mails.size ===> 2000

mail = mails.first

If for instance i want know the date of email or body:

mail.date | mail.body

The time to give me the info is about 40-50 seconds!! It's too long time!!!

For this issue emails accumulate in inbox and i can't read all message of the day. I receive more of thousand emails every day and i have to read them all.

Why it takes so long to access the contents of each email?

I've been using this gem for two years and not previously took so long to access the contents of email

carlinoseldepi commented 9 years ago

I use ruby 1.9.2 and gmail gem 0.5.0

carlinoseldepi commented 9 years ago

For your interest, i found the cause of the long time to access of email contents: in inbox i had 500.000 emails, 6.000 emails not read. I archive 490.000 emails and then the time of access and read each not read emails was about 20 seconds. Without emails archive de time of read each email was about 100 secods.

It's necessary to have inbox clear for fast access

johnnyshields commented 9 years ago

Can you determine whether the latency was on the Gmail server side or within this gem?

When I use this gem with Gmail, I always archive mails after reading in order to keep my inbox clean.

carlinoseldepi commented 9 years ago

The problem was the high content of my inbox, not was a problem of latency in Gmail server o Gmail gem. Always it's more simple to work with 40 emails than with 400000 emails Henceforth i archive mails after reading or once a week (if i need to re-read emails for process it)