Sign in to follow this  
Followers 0
rbhkamal

Need preformace boost for ReDim.

1 post in this topic

Hi,

I'm writing a script that parses multiple registry export files to an array and then writes out the common keys and values. and I noticed that where ever I use ReDim the performance drops down dramatically.

Here is a script that shows how slow ReDim is:

$total = 12000
;Dim $a_s_lines[$total + 1] = [0]
Dim $a_s_lines[0 + 1]      = [0]

$timer = TimerInit()
$count = 0
Do
    $a_s_lines[$count] = $count
    $count += 1
    ReDim $a_s_lines[$count+1]
Until ($count == $total)

ConsoleWrite( "count: "&$count&@LF&"time: "&TimerDiff($timer)&@LF)

#cs
count: 12000
time: 83719.0114944777
#ce

I found a way around the slow performance but I just thought ReDim is a bit too slow and probably someone needs to look at it.

Regards,

RK


"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

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