Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dotnetpro database performance contest
Message
From
11/05/2007 19:13:00
Markus Winhard
Lauton Software GmbH
Nürnberg, Germany
 
 
To
11/05/2007 16:25:52
General information
Forum:
Visual FoxPro
Category:
VFP Compiler for .NET
Miscellaneous
Thread ID:
01224231
Message ID:
01224879
Views:
19
Hi Thomas,

>well, less lines should run faster at least in vfp...

I checked your suggestion and indeed having less variable assignments nearly cuts the CSV export time in half. I just left out STRTRAN() because the original STUFF() is a bit faster (only 0.03 seconds less at 500,000 records, but anyway ;-)).

This is the new CSV export code:
SELECT Table2
SCAN
  lcName = RTRIM( Name )
  lcStrasse = RTRIM( Strasse )
  FPUTS( m.lnFHandle, ;
    STUFF( m.lcName, RAT( " ", m.lcName ), 1, ", " ) +", "+ ;
    STUFF( m.lcStrasse, RAT( " ", m.lcStrasse ), 1, ", " ) +", "+ ;
    STUFF( RTRIM( Ort ), AT( " ", Ort ), 1, ", " ) +", "+ ;
    RTRIM( eMail ) )
ENDSCAN
OTOH this is only about 0.1 seconds faster than my original version but way worse to read. Part two of the contest (remove duplicates and create a table with a different structure) is still more than 17 seconds. The commands I used are INDEX ON...UNIQUE, COPY TO and SELECT...INTO TABLE.

Markus
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform