Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Slow Network Processing

Status
Not open for further replies.

jmcd0719

Programmer
Jun 13, 2001
37
US
Real Simple, but I haven't found the answer anywhere.

For simplicity sake I have 2 PC's on a network.
One stores files and the other processes data

Machine A - File with 100,000 Records

Machine B runs program to sequentially records in database and pack

*Sample program
use MachineA.dbf
go top
do while .not. eof()
if name=""
delete
endif
skip
enddo

The program is not important but any processing on the database is incredibly (1/1000 the speed) slow. The program runs great locally or when I copy the file to the remote pc and send it back.

I have read other threads, but haven't found an answer.

Thanks



 
Obviously, the "network" speed is totally dependent on how you have these two systems connected. Unless you have a fiber optic connection between them, the network speed is going to be substantially slower than local disk access.

Consider doing any "batch" processing with a COM server application located on the 'Server' system. This way the only thing transferred over the network is the request to do the work (sort of a desktop client-server approach).

Rick
 
You are actually bringing over every record across the network to look at it. If you can create a SQL query to accomplish the task you will do the work on the machine with the .dbf -- at least my experience shows putting SQL code in place of the kind you are trying speeds up network access by a tremendous amount.

 
You have picked the absolutly slowest way to do this.

you can replace this entire code with

use machine.dbf
delete for name ==''

if you insist on doing it in a loop

use scan

there has been no reason to write a look with
do while not eof()
skip

since at least version 2.0 if not earlier.

 
I would have thought the hold up would be with packing a networked table ie. shared. Does it calculate faster when the host machine is not running FP?
 
A table can only be packed if it is opened exclusive - whether locally or on a network. Since all FoxPro "calculations" are done locally then it really depends on the workstation's configuration and connection for most of the speed (this of course excludes the COM server example I gave earlier).

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top