Sign in to follow this  
Followers 0
sigil

using COM to search a Lotus database , why is it slow?

2 posts in this topic

#1 ·  Posted (edited)

Lotus Notes question. I know there isn't much Lotus support on this forum, but I'm wondering if it's a problem with the way I'm using COM.

I'm accessing LotusScript through COM to search through a NotesViewEntryCollection for documents that fit certain criteria. The collection will usually contain 400-700 entries. The search is very slow, it only scans about 5 or 6 entries per second. I'm using this:

$entry=$entries.GetFirstEntry
$count=$entries.Count
for $c=1 to $count
 $entrydate=getentrydate($oSession,$entry)
 $subject=getentrysubject($entry)
 if criteria($entrydate,$subject) Then
  doAction($entry)
  $entry=$entries.GetNextEntry($entry)
 EndIf
Next

Is there a memory problem, am I handling the objects in the wrong way? I've heard about some things like "garbage collection," is that something else I should be doing?

I also read about declaring object variables using Dim and so that I can set their type more specifically and make them more efficient that way, like the way I would in Visual Basic for example. How would I declare a variable to be of a certain type?

Edited by sigil

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Is $entries a regular collection? If so, try:

For $entry In $entries
 $entrydate = getentrydate($oSession,$entry)
 $subject = getentrysubject($entry)
 if criteria($entrydate,$subject) Then doAction($entry)
Next

Further isolation depends mostly on those UDFs, like getentrydate(). You could bracket each function with TimerInit() and TimerDiff() to see where all the time goes.

:D

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0