Need for Speed (postscript)

Jim Ault JimAultWins at yahoo.com
Mon Jul 16 01:26:26 CDT 2007


On 7/15/07 8:37 PM, "Ludovic Thébault" <ludovic.thebault at laposte.net> wrote:

> On Sun, 15 Jul 2007 20:58:32 +0100, Beynon, Rob wrote:
> 
> Hello, try to append the result to a file, it's a lot faster :

Caution:  My limited experience with appending to log files is that the
larger the file size, the slower the append.   Files over 4 Mb would show an
observable effect, and over 10 Mb rendered my apps useless.  Of course, I
did not intend to write such large files, but after setting the wheels in
motion, the log files kept growing.  Ooops.

This is especially true in a repeat loop.

answer folder "location of outputData file"
if it is empty then exit to top
put it into pathh
put ("file:"& pathh & the seconds & "outputData.txt") into outFileName
--now each output data file will have a unique name

repeat for each line LNN in textInput
    if LNN contains "good data" then write LNN & cr after url outFileName
    --this will go slower-er and slower-er
end repeat

---------------

A database would not have this limitation, unless it could not handle the
number of records that would be written.

Caution on use of fields to display very large text blocks.  Although it is
possible, it may not be the best way to view and work with the results.
Remember, if it is in a stack in memory, it is all loaded in RAM.

Further, think about what you are going to try to do with the valuable
result (stats, summary report, sort, extract, sets and subsets) and how many
programs could handle this number of lines/records efficiently or at all.


Jim Ault
Las Vegas

On 7/15/07 8:37 PM, "Ludovic Thébault" <ludovic.thebault at laposte.net> wrote:

> On Sun, 15 Jul 2007 20:58:32 +0100, Beynon, Rob wrote:
> 
> Hello, try to append the result to a file, it's a lot faster :
> 
>> global seqDB
>> 
>> ON mouseUp
>> 
>>     put the number of lines in field "massList" into peptides
>> 
>>     put "Processing " & peptides & " masses, please wait..." into
>> field "Output"
>> 
>>     put the long time into field "Start"
>> 
>>  --   put empty into outputData
> 
> ask file "Save as..."
> put it into outputdata
> open file outputData for write
> close file outpudata -- it's to create an empty file if the fle already
> exists
> open file outputdata for append
> 
>>     set the tabstops of field "Output" to 120, 390, 10,20
>> 
>>     put field "ppm" into ppm
>> 
>>     REPEAT for each line pepMass in field "massList"
>> 
>>         put "NEW SEARCH, MASS = " & pepMass & " at " & ppm & " ppm
>> error" & return after outputData
>> 
>>         put  pepMass * ppm/1000000 into massError
>> 
>>         REPEAT for each line peptide in seqDB
>> 
>>             put the third word of peptide into dbMass
>> 
>>   --          IF abs(pepMass-dbMass) <= massError THEN put peptide &
>> "K" & tab & dbMass-pepMass & return after outputData
> 
> IF abs(pepMass-dbMass) <= massError THEN write peptide &
>> "K" & tab & dbMass-pepMass & return to file outputData
> 
> 
>>         END REPEAT
>> 
>>         put "====================" & return after outputData
>> 
>>     END REPEAT
> read from file outputdata until eof
> close file Outputdata
> put it into fld "outputt"
>>   --  put outputData into field "Output"
>> 
>>     put the long time into field "Stop"
>> 
>> END mouseUp
> 
> 
> Ludovic
> http://www.botanic06.com
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the use-livecode mailing list