Link to home
Start Free TrialLog in
Avatar of Eduardo Fuerte
Eduardo FuerteFlag for Brazil

asked on

Could you point out a routine to track the delay of the steps during a VFP operation?

Hi Experts

Could you point out a routine to track the delay of the program steps during a VFP operation?

A client is complaining about the delay when saving data to .DBF (s) files. The problem is intermittent, not always occurs, just at the moment the customer push the "Save" button.

I guess Network latency is probably causing this. If so, how to workaround?

Thanks in advance.
Avatar of jharkins
jharkins
Flag of United States of America image

Use the VFP coverage profiler, which had been a part of VFP since version 6 I believe. You can use it to find out exactly how much time every line of code takes to execute, and if every line of your code is actually being used.

Use SET COVERAGE TO <filename> to turn on data logging, and SET COVERAGE TO without a filename to turn it off. You can also use the debugger to turn it off and on.

Take a look at doughennig.com/Papers/Pub/coverage.pdf for some nice details on how to use it.
ASKER CERTIFIED SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Eduardo Fuerte

ASKER

Thank you for replies!

@Pcelba

Did you operate optical fiber cables?
If so, to operate it is just a matter of to change the twisted cables for optical tables, changing network card of every PC on the network for the new speed, is it sufficient?
* twisted pair cabling
* optical cables
Yes, I am connected via optical cabling to WAN but I am far out to use it for DBF access. I've never used optical cabling on LAN (I would like to test it at least) and yes, if you buy appropriate PC cards and cables then you may connect via fiber. This bad quality video shows how its easy: https://www.youtube.com/watch?v=viwsfpAhfNQ

Of course, you may look at more professional presentation too: https://youtu.be/X6NtP3v1v4Y

You may expect lower latency and higher speed on optical cables comparing to metallic ones. BUT the cabling is just the lowest HW level used for data transfer. The slowness is caused by the (Windows) software which add several more layers to the HW. Simple rule says The newer OS the slower communication...
What do you suggest to workaround this issue?

Using a PC with "older" SO ?
(Maybe change the server, I'm obtaining the hardware used at the server)

The clients and file (DBF(s)) server are Win 7. Is it a good idea to use older clients too? (the impact would not to be very good on this case)

Increasing the memory and processing are always good too. Ok?
I would suggest the Windows Terminal Server and RDS access. Then you can use the application unchanged. I have no clue how much it could cost in your case. Speed problems started with Vista. W7 isn't designed as a server software. And to use different Windows versions at client side isn't recommended namely when you are using collation different from Machine and/or non-English environment.

You could also think about SQL Server implementation and connect all your workstations to one database.  Then you may use local DBFs as the local data cache.  BUT everything this needs major app rewrite... You could (possibly) use the free SQL Express at the beginning. How many users do you have? And what is your DBFs total size?

Increasing the memory is not necessary for VFP application as it can use 1.5 GB at most.
By changing the server to Win XP, f.e. is it a good idea?
Even the file server wouldn't gain performance with meory increase (due the addition of several layers on the process) ?
Also...
I'm planning to change SO from the Server (actually a Win7 on a 4GB memory) to Windows Server, accordingly with this question.
I guess this SO will work much better mamanging the DBF(s) files.
The Win XP is surely faster than new operating systems when accessing shared files. Of course, it is also less secure and not supported by Microsoft except of some ATM versions. Just be ready XP will stop working on some future hardware. It should be possible to install it on a virtual machine a few more years with all the VM's negative consequences but we have to learn how to live w/o XP...

If you decide to install newer OS then you have to ask Microsoft how to tune it up for shared files access. I would guess they don't recommend it at all and you have to be ready for the slowness.

If you are looking for cost effective solution then try to find Linux volunteers and implement MySQL + PHP web solution. Almost everything is free on Linux but you have to find developers or learn it yourself. This just means months or even years of work...
@Pcelba

I particulary use PHP+ MySQL/ MSSQLServer at work.
Specifically to the systems I free distribute to Philantropic entities, VFP is the best choice.
It's all developed and tested. Installed on several places by people that probably I will never know personally.
Kind of people that will have serious dificulties on install Apache, mysql, etc to keep the job running on their sites.  Even start/ stop mysql, reindex and simple operations are unpraticable for them. The same for Apache.
Install a VFP app even with all the easy we give is something dificult for them, about 95% give up just at  the start.
So they wouldn't operate an intranet to work on.
On the other hand, they wouldn't share financial and personal information on a web site I would develop (like they do at a "bank site").
VFP enormously facilitate the job.  Everything is controled by app menu.
OK, but we have to be ready to provide something different than VFP. Almost all VFP programmers are near to the retirement and it will be even worst when Microsoft says "No more Win32 API".  OK, this is not so urgent because Microsoft still supports VB6 and then we will use virtual machines but...

Do you have any successors which would understand VFP code?

VFP is easy for us. How many young programmers do even know about FoxPro? How much longer we'll be able to adapt our applications to new operating systems? Etc. etc.

OTOH, I am optimistic with user's experience. Today's users know how to manipulate PCs, web browsers especially, so they will tend to applications which do not require any installation. Data security is a different question.
Coming late at this,

Set coverage likely will tell you TableUpdate() or close dbfs with USE or FLUSH will take time, but you can't look inside what's happening on the network, analysis tools for network traffic exist, but this will only help to get an insight, you can't do anything different in the VFP code. Of course, you can change to SQL Server.

You say the file server is Win7, well, Win7 is not a server OS, a real file server will need to use a server OS, you'd even be better off with a NAS, if you ask me, client systems and the shares they offer are less good for multiple user access than servers, there's a reason for server vs client OSes. It's not just about selling CALs.

Hardware acceleration will help, yes, both with latencies and transfer speeds. I don't have much experience with optical fibers, we had one backbone in a company LAN, only a central switch backbone connection to the server room was oiptical, all clients hab 100 mbit, so that was already quite some time ago, 2000-2005 perhaps.

10GbE standard has 10 technical specifications, 8 for optical fiber, 2 for cables. They all offer the 10gbit, though, signal speed is not that much better, optical fiber can just offer transfer at several wavelengths (colors) of light and the trend goes to optical only if you look at next standards specified but not yet commercially available. I wouldn't expect wonders from 10GbE optical vs copper though, it's both 10 Gbit.

I have left maintenance of DBFs as data storage in 2008, only using MySQL and MSSQL backends.

Bye, Olaf.
Hi

Regardingly this issue I had opened 02 other questions and now I'm waiting next days when the user will install a SSD HD and disable some features (Aero) to give more performance to their server also.

Here it is:
1st Question

2nd Question

Actually the VFP apps works like PDV(s) something that  allied with the other facts mentioned is better attended with a Desktop app.
Years ago I had tried to convert to .net Winforms  one of the VFP apps, since I had never used .net to professionally develop of a complete app I felt it is hard to do this convertion and the result would be very similar than VFP. I'm planning to develop a better business documentation of the systems, at least.

I guess this and the 02 other questions will be replied togheter. After the client finally test.
Ops..
PDV => POS (Point Of Sale)
The mainly performance problem is related to my own code.

A query to determine the 5 items best sellers, fired at each sell causes the worst loss of time, captured by the SET COVERAGE.

An extra form refresh - that the trace couldn't capture caused more delay,

After installing HD SSD, unable Aero on Win7 . the performance is quite good.

Thank you for the guidance!