#77306 - 2003-10-31 08:36 AM
Script to test String Expressions
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11629
Loc: CA
|
Jens,
Here is the Post Prepped code with some minor modifications added.
I get the exact same results though as Patrick got in the original thread. The script runs for about 33 seconds and then quits.
This is on a PIII 933MHz with 512MB RAM Windows 2000 SP4
String_Expressions_Test.kix 10/30/2003 11:41PM Original Topic Thread is here: http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=14;t=001255
quote: String Length Start = 0 String Length Final = -769,803,776 String Segment Length = 10,000,000 # Segments To Add = -77 Final String Length (0)=0=0 MB Script Running Time: 33388
cls
break on
dim $rc
$rc=setoption('NoVarsInStrings','on')
$rc=setoption('Explicit','on')
dim $StartStringLength, $FinalStringLength, $StringSegmentLength, $StringSegmentsToAdd
dim $SegmentCount, $CurrentStringLength, $CurrentSize, $StringSegment
dim $TimerStart, $TimerStop, $TimerTotal
$TimerStart = @TICKS
$StartStringLength = 0
$FinalStringLength = 25000000000
$StringSegmentLength = 10000000
$StringSegmentsToAdd = cdbl($FinalStringLength)/$StringSegmentLength
dim $StringSegmentPart[$StringSegmentLength/1000], $String[cdbl($StartStringLength)/$StringSegmentLength]
$StringSegmentPart = join($StringSegmentPart,'abcdefghij')
$StringSegment = ''
for $SegmentCount = 1 to 100
$StringSegment = $StringSegment+$StringSegmentPart
next
$SegmentCount = 0
if ubound($StartStringLength)
$String=join($String,'abcdefghij')
endif
? 'String Length Start = ' + formatnumber(len($String),0,-1)
? 'String Length Final = ' + formatnumber($FinalStringLength,0,-1)
? 'String Segment Length = ' + formatnumber(len($StringSegment),0,-1)
? '# Segments To Add = ' + formatnumber($StringSegmentsToAdd,0,-1)
while $SegmentCount<$StringSegmentsToAdd and not @ERROR
$String=$String+$StringSegment
$SegmentCount=$SegmentCount+1
$CurrentStringLength=cdbl(len($String))
$CurrentSize=val($CurrentStringLength/1024/1024)
? 'Current String Length ('+formatnumber($SegmentCount,0,-1)+')=' +formatnumber($CurrentStringLength,0,-1)+ '='+formatnumber($CurrentSize,0,-1)+' MB'
loop
$TimerStop = @TICKS
$TimerTotal = $TimerStop-$TimerStart
if not @ERROR
? 'Final String Length ('+formatnumber($SegmentCount,0,-1)+')=' +formatnumber($CurrentStringLength,0,-1)+ '='+formatnumber($CurrentSize,0,-1)+' MB'
? 'Script Running Time: '+$TimerTotal
else
? 'Error at step '+$SegmentCount+'='+formatnumber(len($String),0,-1)+'='+formatnumber(cdbl(len($String))/1024/1024,0,-1)+' MB'
? 'Script Running Time: '+$TimerTotal
endif
exit 0 |
|
|
Top
|
|
|
|
#77310 - 2003-10-31 10:31 PM
Re: Script to test String Expressions
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11629
Loc: CA
|
Jens,
Can you please update your code to bypass this issue.
quote: my script does ubound() on every millionth char thus it's limit is million times int-limit
Thanks...
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 988 anonymous users online.
|
|
|