How to enhance the perfomance of an action generated by SSJS code

I am facing a problem in SSJS. My code is taking very long time to build up the document collection consisting of more than 5000 documents. In my SSJS code I have an array of Document Unique ID’s named “sortkeyarray1”.

I am writing the following code to populate Notes Document Collection of more than 5000 documents.

db=database;

sdc=db.getProfileDocCollection(“$$Blank-DocumentCollection”);

for(c=0;c<@Elements(sortkeyarray1);c++)

{

doc=db.getDocumentByUNID(sortkeyarray1[c]);

sdc.addDocument(doc);

}

Could anyone please suggest, is there any faster way to populate Notes Document Collection for more that 5000 documents.

Thanks in advance.