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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need to speed up my Clipper application

Status
Not open for further replies.

dosdemon

Programmer
Jan 7, 2002
8
0
0
US
I have a fifteen year old Clipper 5.3, Blinker 5.1 business application for 50 users in a manufacturing environment installed on a Dell NT Server over a 100Mb network purchased in 1999. The users mostly have Win 95, 98, XP, and 2000 workstations. My .dbf's typically contain 20,000 to 200,000 records and I am efficiently using Clipper .ntx files, however, users have always been complaining of slow processing speed. I have proposed to increase overall system speed by upgrading to a modern Dell Windows 2003 server and the swiches, hubs, routers, and network cards to 1Gb; I am anticipating a speed increase of up to 25% due to the modern server and an increase of up to 200% due to the faster network speed. Of course, the owners of my company want a more significant speed increase. I don't want to buy a new application or learn a new programming language; the system is realiable and I can meet the ever-changing company requirements through daily software changes. I remember reading on this site some of the benefits of XHarbour. I am looking for a low cost, 100% compatible, reliable Clipper replacement that runs the application much quicker than is currently being used. I don't want to learn a new language and I don't want to lose any of the capabilities that I currently have. I'd appreciate your professional comments on my situation and the simplicity and reliability of transferring from Clipper to XHarbour, and I thank you for your time.

Sincerely,

Greg Rasmussen
SoCal Apparel
 
Aha, a converter ;-)

xHarbour (or Harbour-project where it spun off) are very compatible (99,9%) with the original Clipper/xBase language and ecosystem.
Usually converters try to regain a new life for an old application, by dressing it up with a GUI front-end, but in this case I wouldn't advise that (yet).
First and probably most important is to get the xHarbour compiling process to work properly (start with the trial from xHarbour.com or the free package from xHarbour.org and the free Borland C compiler).
After that has worked out, see what speed improvement you have gained already :-D by now running a proper 32-bit C-compiled executable with access to all available memory, instead of the 16-bit Clipper stuff with access to limited memory (even when using Blinker).
The speed of the (x)Harbour DBFNTX RDD is already a vast improvement over the Clipper edition, and can be further enhanced by switching to the DBFCDX RDD, which is even more efficient, especially over a network.

Next it's rather important to know how you handle processing of large(r) recordsets in your app, by iterating over all of them and processing data if conditions apply, or by querying in SQL style, putting an operation to a set of records?
In the latter case, processing can be easily improved by replacing the dbf/ntx database structures by a MySQL db using the free Mediator RDD ( This is a full dbf/ntx replacement RDD, that hardly needs changes in your application, unless you hard-coded file-extensions and checks like that in your source :-(

Replacing the hardware is a good idea as well, as the server hardware is rather old, and improvements in newer components is evident.
When staying with the original dbf/ntx construction, the improved lan-speed should give better performance, but relieving the network from the big dataload is a much better solution.

HTH
TonHu
 
I cannot improve on Ton Hu's excellent response but only second it. He pointed me at xHarbour a couple of years back and it has done wonders for keeping legacy clipper apps alive and providing a path for improving them and making them compatible with newer OS's.

The speed improvement is excellent. I also use Mediator for db's shared over the internet with most satisfactory results, but it requires more changes to the programs to work well than just going to xHarbour, which can be configured to compile most CL 5.x source code with very minimal changes.

Jock
 
Thanks to TonHu and Jock for your responses, BUT...
After downloading Xharbour, I wrote a "Hello world" prg and tried to compile it. No good. I don't know what directory I should be in, what my environment variables should be, what the compiling command set is, or what the linking command set is. I saw no samples on how to do even the simplist of operations. If you could please direct me to an elementary source of help, I'd appreciate it.
Until then, sailing around the Harbour is only a fantasy...

Greg
 
Hi Greg

In addition to xharbour itself, you will also need a supported C compiler. I use the Borland C++ ver 5.5 compiler aka bcc32 command line tools (free) available from many sources. Google is your friend.

You should install that into the default directory setup (\borland\bcc55).

Also assume you have installed xharbour into its default directory. Note that the docs for xHarbour are not included in the binary download - a lot more is available in the source. They do however include make templates for compiling and linking which can be used to create your own customozed compile and link batch file.

The number of options and libraries available are many and bewildering. However, if you just want to compile clipper source in a mode compatible with Cl S/87 or 5.x you can use something like:
Code:
@echo off
REM
REM Build script for single file xHarbour (PRG) programs
REM with implicit start procedure declaration
REM Links Multithreaded version of xHarbour libraries
REM
REM Usage:  xhbld file
REM
REM Do not specify PRG extension!
REM
REM Note that your Bornand C++ 5.5 (bcc32) compiler bin folder
rem should be in your path environment variable.
REM Remember to customize XHBDIR and XHBBUILD variables!
REM
REM set XHBDIR to the directory where HARBOUR is installed
SET XHBDIR=c:\xharbour
REM set XHBBUILD to the name of the xHarbour build (for ex. build997)
SET XHBBUILD=build1000
del %1.exe
del %1.obj
%XHBDIR%\bin\harbour %1.prg /i%XHBDIR%\include
if errorlevel 1 goto error_end

bcc32 -O2 -tWM -I%XHBDIR%\include %1.c %XHBDIR%\lib\debug.lib %XHBDIR%\lib\vmmt.lib %XHBDIR%\lib\rtlmt.lib %XHBDIR%\lib\gtwin.lib %XHBDIR%\lib\codepage.lib %XHBDIR%\lib\lang.lib %XHBDIR%\lib\rddmt.lib %XHBDIR%\lib\macromt.lib %XHBDIR%\lib\ppmt.lib %XHBDIR%\lib\dbfntxmt.lib %XHBDIR%\lib\dbfcdxmt.lib %XHBDIR%\lib\common.
lib %XHBDIR%\lib\pcrepos.lib %XHBDIR%\lib\hbsixmt.lib %XHBDIR%\lib\dbffptmt.lib

if errorlevel 1 goto error_end
echo Build OK.
goto end
:error_end
echo !!!!!!!!!!!!!! ERROR IN BUILD !!!!!!!!!!!!!!!!!!!!
:end

Note that the bcc32 line and the ones following it (list of libs) should all be on one line (couldn't get it pasted in properly).

Add the path to borland\bcc55\bin and xharbour\bin to your path variable. Put your version of this batch file in xharbour.bin as xhbld.bat or whatever and then just use xhbld program at the command line, where program.prg is the top level program you want to compile.

That should enable you to compile a hello world program.
Ultimately you will likely want to use makefiles and utilities when building larger apps, but a batch file like this is fine for compiling older code in a (mostly) compatible mode.

Hope this helps
Jock
 
Using HBMake would help in setting up more complex scripts. HBMake has a make-like feature that it only compiles the sources that have changed, and links all objects into one executable. On most of my xHarbour projects I use it.

Use HBMake with /h option to get some help.

HTH
TonHu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top