Announcement

Collapse
No announcement yet.

Slow Running Code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Slow Running Code



    Any idea why this code takes over 6 minutes to run (Pentium II 233, 64mb ram)?

    Rawdata is a fixed STRING of length 156960 bytes, mapdata() and t are of type LONG

    FOR t=1 TO 26160
    mapdata(1,t)=CVI(RawData,1+(t-1)*6)
    mapdata(2,t)=CVI(RawData,3+(t-1)*6 )
    mapdata(3,t)=CVI(RawData,5+(t-1)*6 )
    NEXT t

    Rawdata is read from a file. If I read it in 6 byte chunks and convert then it will run in 2 seconds. So I assume the problem is the huge string, but I would not expect 6 minutes!

    Brent Boshart

  • #2
    Brent --
    replace all to
    ReDim mapdate(1 : 3, 1 : 26160) As Integer At VarPtr(RawData)

    For dynamic strings use StrPtr instead of VarPtr

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

    Comment

    Working...
    X