home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 8 Other
/
08-Other.zip
/
timetest.zip
/
readme.txt
Wrap
Text File
|
1997-05-24
|
7KB
|
158 lines
Performance test of Open32 using Delphi and VP/2
by Allan Mertner, 23 May 1997
fPrint (UK) Ltd recently released a new version of Virtual Pascal for
OS/2 that provides compatibility with Borland Delphi. Using this
compiler, I have done a performance test of the code output by the OS/2
compiler and compared it against the performance on native Windows.
The results confirm what has been common knowledge for a while: The
Open32 library IBM supplies for making it easy to convert Windows
applications to the OS/2 platform is both buggy and slow.
The Delphi source code for the program used for testing is included in
the SRC directory of this archive. The source compiles with Borland
Delphi v1 or v2, or Virtual Pascal for OS/2. In other words, the same
source code produces executables for Win16, Win32 and 32-bit OS/2.
The resulting 3 executables can be found in the EXE subdirectory, and
are called TESTOS2.EXE, TESTW32.EXE and TESTW16.EXE, respectively.
Executable sizes
First off, don't put too much into the size of the 3 executables. The
OS/2 version is smallest because it is compressed using OS/2's built-in
ExePack 2 compression; if it was uncompressed, the size would be 266kB
instead of the 165kB it is in this archive. Windows does not offer a
similar feature, so we obviously end up with larger executables.
What the test does
The test is very simple: I draw some labels on a form, and count how
often I can do it. The test program has two "modes" of test. In the
first mode, the program hooks the IDLE message and updates the labels
every time the operating system is idle. In the second mode, I simply
update the labels as many times as possible in 10 seconds.
For the benchmark results, I used the second test to rule out any
differences in idle processing between the operating systems, although
the results were almost identical.
The scores listed below are a simple count of the number of updates the
program made per second during the run.
Executable speed
The exciting bit comes when trying to run the programs in various
operating systems. The Win32 executable runs in both Windows 95 and NT,
the Win16 one runs in both NT, 95, Win3.x and WinOS/2, and the OS/2 one
of course runs only in OS/2.
Each executable was run on the machines I have available, with nothing
running in the background. I ran each program 3 times and took the
highest score achieved - the results are as follows:
On my Pentium Pro 200, with a Number Nine I128 graphics card and 32MB of
memory, the results were:
Operating System Executable Version Result (higher is better!)
Windows NT 4 Win32 448
Windows 95 Win32 411
Windows 95 Win16 404
Windows NT 4 Win16 291
OS/2 Warp 4 OS/2 48
On my older box, a 486 DX/2 66 with an ATI Mach 32 card and also 32MB of
memory, the results were (Limited by OS's available :)
Operating System Executable Version Result (higher is better!)
WinOS/2 v3.11 Win16 91
OS/2 Warp 4 OS/2 9
In summary, the OS/2 version is quite slow, NT is fastest at executing
Win32 programs, and '95 is fastest at executing 16-bit ones. This is
not surprising, but it certainly is surprising to me that the OS/2
version running on a Pentium Pro 200 is half as fast as the Win16
version running in WinOS/2 on a 486/66!
The "Benchmark" tab of the notebook in the program also contains these
results in a string grid. If you switch to this page and then run the
test, you can see how fast the labels are updated when they are not
visible :)
Program looks
The OS/2 version of the program suffers from a number of visual
problems. Although it works and does its job, it is visually
unappealing. The main problems are to do with
* colour mapping (the background is white in places),
* bitmap drawing (the tabs on the notebook control are drawn in the
wrong colour due to a known bug in Open32's BitBlt function),
* font translation (try to use an Ms Sans Serif font in a program :),
* font clipping (for some reason, the fonts are generally larger in
OS/2 than in Windows. This means that the text is clipped in places,
if the default rectangle sizes from Windows are in place. IBM claims
this is a programming error, not a bug in Open32),
* speed. I think I've covered that adequatly.
The font clipping problem can sometimes be worked around by manually
sizing all labels to be a bit higher and wider than default. To
demonstrate this, the test program contains both an "Autosize" and a
"ManualSize" tab containing the same text.
Discussion
IBM needs to work on their Open32 library! They need to hire developers
that care about code quality, both in terms of functionality and in
terms of speed. A 10% or even 50% increase in speed is *not* good
enough; an increase by a factor of 8 would make a difference.
It is extremely unlikely that IBM will dedicate the resources required
to do this however. Open32 has shown its usefulness as a technology
demonstration, nothing more - applications using it are obviously
inferior to programs that use a native API.
The really frustrating part about Open32 is that it is not documented.
When a discrepancy between Open32's behaviour and Windows is uncovered,
it is a tiresome process to report the problem to IBM, provide a test
case for the problem, wait for the lab to look at it, wait for the
problem to become an approved problem, and finally - after several
months - be told that it is a permanent restriction. If only the
differences and shortcomings were documented, they could be worked
around. As it is, IBM has released Open32 as a Windows API emulation
library with no restrictions imposed, and it doesn't work.
During development of the Virtual Pascal compatible VCL source code (the
VCL is the component class library used by Delphi), we wanted to work
around the problems we found by using native OS/2 API calls in some of
the code, and only rely on Open32 where it actually works. This also
proved impossible, again mainly due to lack of documentation. Open32
implements a number of Windows functions, obviously by calling OS/2
functions that do a similar job. However, all handles and structures
returned by Open32 are Windows equivalents, and no documentation about
the internal structures used by Open32 is available, making it
impossible to make a hybrid solution.
Finally
Thank you for listening - if you have any comments or suggestions, feel
free to e-mail me at mertner@ibm.net. If you feel it might help, you
can also write to IBM and tell them to do something about Open32 :-)
Oh, and the source and executables for the timetest program are hereby
donated to the public domain ;)
Yours truly,
Allan Mertner