And so he did a couple of side steps into @function and lotusscript coding. NotesStream was mentioned as a performance booster when building (long) strings e.g. in webagents when building return data for a webservice. During execution of demo code the difference between concatening a string using
I immediately saw an opportunity to improve the performance of the several agents we have running every day to transport product and other data from Notes to our Websphere Commerce servers via xml files. Some of them deliver a xml file of over 100mb.
So I put it to the test running 4 agents delivering the same result and each of them differing slightly in how the data is written.
- agent builds string (concatenate) to 65000+ bytes and than writes to file.
- agent builds string (concatenate) per record and writes to file per record.
- agent write to file directly, line by line.
- agent writes to file line by line using NotesStream.
The output build has the following structure per record:
<persoon>
<voornaam>Jan</voornaam>
<achternaam>Jansen</achternaam>
<woonplaats>Scherpenzeel</woonplaats>
<persoon>
The results in performance are listed below:
- Concatenated string test (concat string to 65000+ bytes before write).
[Elapsed time: 296 seconds] [processed 123838 records] - Concatenated string test (concat/write per record).
[Elapsed time: 163 seconds] [processed 123838 records] - Direct print to file test.
[Elapsed time: 169 seconds] [processed 123838 records] - NotesStream string test.
[Elapsed time: 170 seconds] [processed 123838 records]
And as Martin mentioned in his session, NotesStream is certainly helpful in webagents that build return xml's on request.