Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Filling Outline control with dir. structure
Message
 
À
30/03/1998 10:26:17
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00087549
Message ID:
00088125
Vues:
62
>Hi George,
>Before replying I made some tests too. Here is the code I used :
>
>clear all
>set escape on
>start=seconds()
>*start1 = start
>create cursor dirs (dirname c(254))
>insert into dirs values ("c:\")
>*browse nowait
>*dimension dirs[1]
>*dirs[1]="c:\"
>=subdirs("c:\")
>? seconds()-start
>
>function subdirs
>lparameters cDir
>cDir = cDir+iif(right(cDir,1)="\","","\")
>local aSubdirs, ix
>dimension aSubdirs[1,1]
>nCount = adir(aSubdirs,cDir+"*.*","DHS")
>asort(aSubdirs)
>*local ix
>for ix = 1 to m.nCount
>	if aSubdirs[m.ix,1]#"." and "D"$aSubdirs[m.ix,5]
>*		dimension dirs[alen(dirs)+1]
>*		dirs[alen(dirs)]=cDir+aSubdirs[m.ix,1]
>*		=subdirs(dirs[alen(dirs)])
>		insert into dirs values (cDir+aSubdirs[m.ix,1])
>*		if seconds()-start1 >= 1  && Show what's going on app once per min
>*			start1 = seconds()
>*			show window (wontop()) refresh
>*		endif
>		=subdirs(trim(dirs.dirname))
>	endif
>endfor
>
>First to my surprise there wasn't much difference between doing to a cursor and array (under 1 sec and of course liked it). Also showing the user what's going on with above "if" or "if reccount()%20 (or 50)" slowed down less than 1.7 secs. My machine K6-200 with 64Mb RAM, 1465 directories. The results were changing by CPU load however (no change in method lasts between 23 - 34 secs). UT was online all the time and whenever the test hit refresh of UT (60 secs set) it slowed down to 34 secs. In between it lasted 23-24 secs. I think it'll be faster if I cut all my network and disable TCPIP. Not bad especially when user see what's going on (seems 50-65 dirs are processed per sec). I'm newbie to win32api and was disappointed to see that VFP no longer supports "load-call xxx.bin". I was doing assembly stuff for hw and speed gain. Now everything is "?CX" or "?LL"ed. I don't think API would make it faster but not sure. Also I think time would change depending on defragmentation, dir
>placement on disk, disk size, SCSI, EIDE or EIDE-Ultra disks etc (mine 4.3 Gb Quantum EIDE and haven't defragmented for at least a month).
>Cetin
I figure that there were 3 reasons for the difference in speed. The extra RAM, the MMX processor (supposedly up to 1/3 faster), and no network at home (like you, I was on the UT here). Still, the drive at the house is larger and contained more directories. My guess would be that whether or not the disk was DEFRAGged would make little, if any, difference.

Still I did figure out that I could speed up the API calls by using:

IF BITTEST(ASC(RIGHT(lcstruct, 1)), 4) &&lcstruct is the string structure

To test if it was a directory or not.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform