Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to make this code faster
Message
De
03/05/2013 02:12:40
 
 
À
03/05/2013 01:50:47
Mk Sharma
Shrishti Solutions
Mumbai, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01572484
Message ID:
01572599
Vues:
47
I think in cases like this you should at least:

post your original timing results
post the results of each version you tried
give a description of the tables involved
give a description of the actual hardware the test was run on.




>Thank you,
>
>Warm regards,
>mk.
>
>>Update is posted: http://www.foxite.com/archives/0000376181.htm
>>
>>It may not be accurate. It's been a long day. Please double-check everything.
>>
>>Best regards,
>>Rick C. Hodgin
>>
>>
>>>Sample files
>>>http://www.foxite.com/archives/0000376177.htm
>>>Warm regards,
>>>mk.
>>>
>>>
>>>>I would like to help you but I'm pressed for time today.
>>>>
>>>>I think setting the relationships and doing the IIF() comparison will yield better results. You have some unusual dependencies here though, which I'm not sure about. I'd like to see about getting a small set of your data and then being able to validate against the slow function which is working, against any optimized versions.
>>>>
>>>>Best regards,
>>>>Rick C. Hodgin
>>>>
>>>>
>>>>>Little change in my code and it is taking little less time.
>>>>>
>>>>>How to do below code with REPLACE ?
>>>>>
>>>>>
>>>>>Local lcmasterid, lnavgrec1, lnavgrec2, lnavgrec3, lnpackno, lntakano, lntotrec, lntrnno
>>>>>USEFILE('cuttm')
>>>>>USEFILE('cuttct')
>>>>>USEFILE('packtc')
>>>>>lntakano = 0
>>>>>Select cuttm
>>>>>Set Order To takano
>>>>>Select cuttct
>>>>>Set Order To takano
>>>>>Select packtm
>>>>>Set Order To MASTERID
>>>>>Select packtc
>>>>>Set Order To takano
>>>>>Select cuttct
>>>>>
>>>>>Wait Window 'Working... Taka... Please Wait...' At Srows() / 2, Scols() / 2  Nowait
>>>>>
>>>>>Select cuttct
>>>>>Scan For Not Empty(takano)    && Created a BINARY index on empty(takano)
>>>>>   lntakano = takano
>>>>>   Do Case
>>>>>      Case Seek(m.lntakano, 'packtc', 'takano')
>>>>>         If Seek(packtc.MASTERID, 'packtm', 'masterid')
>>>>>            lnpackno = packtm.packno
>>>>>			Replace	;
>>>>>					packed With	Iif(m.lnpackno <> 0, 'Y', ' ') ;
>>>>>					packno With	m.lnpackno ;
>>>>>					recuttno  With 0  ;
>>>>>				In cuttct
>>>>>         Endif
>>>>>      Case Seek(m.lntakano, 'cuttm', 'takano')
>>>>>         lntrnno =	cuttm.trnno
>>>>>         Replace packed With Iif(m.lntrnno <> 0, 'Y', ' '), packno With 0, recuttno With m.lntrnno In cuttct
>>>>>      Case Seek(m.lntakano, 'cuttm', 'takano1')
>>>>>         lntrnno =	cuttm.trnno
>>>>>         Replace packed With Iif(m.lntrnno <> 0, 'Y', ' '), packno With 0, recuttno With m.lntrnno In cuttct
>>>>>      Otherwise
>>>>>         Replace packed With ' ', packno With 0, recuttno With 0 In cuttct
>>>>>   Endcase
>>>>>Endscan
>>>>>Wait Clear
>>>>>
>>>>>
>>>>>
>>>>>Warm regards,
>>>>>mk.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform