Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIdIMAP4::RetrieveHeader speed
#1
I am tasked with downloading all message headers from many mail boxes, so this is my 1st try with VCL:

Code:
//TId components managed by the IDE
TIdIMAP4 *IdIMAP4;
Code:
TIdMailBox *IdMlBx;
Code:
TIdMessage *IdMsg;
Code:
//....IdIMAP4 is connected and authenticated
int nMsgs;
UnicodeString s = "-1";
DWORD t;
  try{
    if( !IdIMAP4->ExamineMailBox(asName,IdMlBx) )
      throw Exception( "!ExamineMailBox" );
    nMsgs = IdMlBx->TotalMsgs;
    t = ::GetTickCount();
    for( int iMsg=1; iMsg<=nMsgs; iMsg++ ){
      if( !IdIMAP4->RetrieveHeader(iMsg,IdMsg) )
        throw Exception( "!RetrieveHeader " + IntToStr(iMsg) );
      //IdMsg->UID is empty (?)
      if( !IdIMAP4->GetUID(iMsg,s) )
        throw Exception( "!GetUID " + IntToStr(iMsg) );
    }//for
    t = ::GetTickCount()-t;
  }catch( EIdException &e ){
    return false;
  }//catch( EIdException &e )
  catch( Exception &e ){
    return false;
  }
double dt = (double)t/(double)nMsg;//252.53495873621098[ms]

My problem is the value of dt: it is greater than 250ms  Huh

Meaning that I can only get 4 headers per second - this is unacceptably slow.

Tested on different mail boxes of different accounts; PC is connected to inet with 200x20 plan.

Is there a way to call RetrieveHeader for more than just 1 message at a time?

Thanks in advance, and have a nice weekend. Boba TC.
Reply


Messages In This Thread
TIdIMAP4::RetrieveHeader speed - by Boba TC - 06-24-2022, 09:10 PM
RE: TIdIMAP4::RetrieveHeader speed - by rlebeau - 06-25-2022, 06:46 PM
RE: TIdIMAP4::RetrieveHeader speed - by Boba TC - 06-25-2022, 07:13 PM
RE: TIdIMAP4::RetrieveHeader speed - by Boba TC - 06-25-2022, 10:58 PM
RE: TIdIMAP4::RetrieveHeader speed - by rlebeau - 06-27-2022, 01:18 AM
RE: TIdIMAP4::RetrieveHeader speed - by Boba TC - 06-26-2022, 12:19 AM
RE: TIdIMAP4::RetrieveHeader speed - by Boba TC - 06-26-2022, 04:15 AM
RE: TIdIMAP4::RetrieveHeader speed - by Boba TC - 06-29-2022, 02:36 AM
RE: TIdIMAP4::RetrieveHeader speed - by rlebeau - 06-29-2022, 03:26 PM
RE: TIdIMAP4::RetrieveHeader speed - by Boba TC - 06-30-2022, 02:14 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)