NotesStream

I am trying to improve the performance of an agent when it runs with larger files. I changed the code that was using open and Print in favor of the NotesStream class. I am assuming that it is faster. Is it? Do I need to be concerned with default buffer size and flushing memory with NotesStream??? Where can I find more detailed documentation on NotesStream than what is in the Help documentation?

Subject: RE: NotesStream

I am assuming that [NotesStream] is faster [than Print#]. Is it?

I don’t know whether anyone knows. Why don’t you do some testing; then you can write an article about it and try to sell it to LDD.

I haven’t compared them myself, but I expect it depends what you’re doing. I don’t think it’s likely to be a great deal faster if you’re generating a line at a time anyway. However, if you have great blocks of text that you want to plop into a file, it would be a good choice.

Because LotusScript code is not compiled down into machine language, any processing that you do in LotusScript is likely to be slower than the same processing occurring in the system functions and methods you call. However, it also takes time to make a call. If you want to output a line of text, and what you have doesn’t have linefeeds in it already, it’s probably a toss-up whether it’s faster to call Print, which adds the linefeed for you, vs. concatenating the newline sequence onto the string and passing it to NotesStream.WriteText, vs. calling WriteText twice – once with the line and once with the newline sequence.

Do I need to be concerned with default buffer size and flushing memory with NotesStream???

Since these things are not under your control with NotesStream, no. Of course, this also means that you don’t have as much chance to tune the performance by selecting a buffer size, like you can with the Open statement.

Where can I find more detailed documentation on NotesStream than what is in the Help documentation?

Dunno.

Subject: RE: NotesStream

It turns out that it is faster for what we are doing. Our agent used to time out on a 2 meg file after 500 minutes! Now it processes even 3 meg file well under the 500 minute limit.

Someone does need to write up some more documentation on NotesStream.