473,765 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C program verrrry slow on Win98 DOS shell

Hi. I wrote a program in C that spends most of its time doing integer
arithmetic (on a data set loaded at run time), with a negligible
amount of I/O. I compiled it with lcc-win32 as a console application.
The program took 10 hrs to crunch a particular batch of data. I also
compiled with Open Watcom 1.1 with similar results. However, I
compiled the program on Linux (I have a dual boot system) with gcc,
and it took 12 MINUTES to crunch the same data. Can someone answer:
where is my bottleneck on DOS?

I'm running the console as a DOS shell under Windows 98 on an Athlon
XP 1900+ with 512 MB ram. I'm only using the standard C libraries. My
config.sys file is empty. My Autoexec.bat file only contains PATH
information. Do I need to add lines for emm386, himem, and all that
rot? Or is it something else entirely? Please advise. Thanks.
Nov 13 '05 #1
11 2919
Brett wrote:

Hi. I wrote a program in C that spends most of its time doing integer
arithmetic (on a data set loaded at run time), with a negligible
amount of I/O. I compiled it with lcc-win32 as a console application.
The program took 10 hrs to crunch a particular batch of data. I also
compiled with Open Watcom 1.1 with similar results. However, I
compiled the program on Linux (I have a dual boot system) with gcc,
and it took 12 MINUTES to crunch the same data. Can someone answer:
where is my bottleneck on DOS?


All your data is sent to a Microsoft server for storage and analysis :-)

/david

--
Andre, a simple peasant, had only one thing on his mind as he crept
along the East wall: 'Andre, creep... Andre, creep... Andre, creep.'
-- unknown
Nov 13 '05 #2
Brett wrote:
Hi. I wrote a program in C that spends most of its time doing integer
arithmetic (on a data set loaded at run time), with a negligible
amount of I/O. I compiled it with lcc-win32 as a console application.
The program took 10 hrs to crunch a particular batch of data. I also
compiled with Open Watcom 1.1 with similar results. However, I
compiled the program on Linux (I have a dual boot system) with gcc,
and it took 12 MINUTES to crunch the same data. Can someone answer:
where is my bottleneck on DOS?

I'm running the console as a DOS shell under Windows 98 on an Athlon
XP 1900+ with 512 MB ram. I'm only using the standard C libraries. My
config.sys file is empty. My Autoexec.bat file only contains PATH
information. Do I need to add lines for emm386, himem, and all that
rot? Or is it something else entirely? Please advise. Thanks.


Do you use int, short or long? Plain, near, far, huge pointers?

--
Michel Bardiaux
Peaktime Belgium S.A. Bd. du Souverain, 191 B-1160 Bruxelles
Tel : +32 2 790.29.41

Nov 13 '05 #3
In comp.lang.c Brett <ca******@yahoo .com> wrote:
Hi. I wrote a program in C that spends most of its time doing integer
arithmetic (on a data set loaded at run time), with a negligible
amount of I/O. I compiled it with lcc-win32 as a console application.
The program took 10 hrs to crunch a particular batch of data. I also
compiled with Open Watcom 1.1 with similar results. However, I
compiled the program on Linux (I have a dual boot system) with gcc,
and it took 12 MINUTES to crunch the same data. Can someone answer:
where is my bottleneck on DOS?


There's an interesting thread regarding optimization issues on
comp.lang.c++.m oderated ("Huge C++ Optimization Hole") that might possibly be
relevant...

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cybers pace.org | don't, I need to know. Flames welcome.
Nov 13 '05 #4
ca******@yahoo. com (Brett) wrote:
# Hi. I wrote a program in C that spends most of its time doing integer
# arithmetic (on a data set loaded at run time), with a negligible
# amount of I/O. I compiled it with lcc-win32 as a console application.
# The program took 10 hrs to crunch a particular batch of data. I also
# compiled with Open Watcom 1.1 with similar results. However, I
# compiled the program on Linux (I have a dual boot system) with gcc,
# and it took 12 MINUTES to crunch the same data. Can someone answer:
# where is my bottleneck on DOS?

If the data is too large too fit in real memory, I would expect the
difference is in virtual memory implementations . One OS is thrashing on
your code, the other isn't. There's not too much you can do in a system
independent way to avoid thrashing: maintain locality of reference as
much as possible.

--
Derk Gwen http://derkgwen.250free.com/html/index.html
You hate people.
But I love gatherings. Isn't it ironic.
Nov 13 '05 #5
On Tue, 21 Oct 2003 16:06:34 UTC, ca******@yahoo. com (Brett) wrote:
Hi. I wrote a program in C that spends most of its time doing integer
arithmetic (on a data set loaded at run time), with a negligible
amount of I/O. I compiled it with lcc-win32 as a console application.
The program took 10 hrs to crunch a particular batch of data. I also
compiled with Open Watcom 1.1 with similar results. However, I
compiled the program on Linux (I have a dual boot system) with gcc,
and it took 12 MINUTES to crunch the same data. Can someone answer:
where is my bottleneck on DOS?


As you sayd: DOS

--
Tschau/Bye
Herbert

eComStation 1.1 Deutsch wird jetzt ausgeliefert!
Nov 13 '05 #6
Brett wrote:

<snip>
where is my bottleneck on DOS?


Redmond, Washington USA

If it runs better under Linux, then why not just run it under Linux?

--
Morris Dovey
West Des Moines, Iowa USA
C links at http://www.iedu.com/c

Nov 13 '05 #7
Michel Bardiaux <mb*******@peak time.be> wrote in message news:<3F******* *******@peaktim e.be>...
Brett wrote:
Hi. I wrote a program in C that spends most of its time doing integer
arithmetic (on a data set loaded at run time), with a negligible
amount of I/O. I compiled it with lcc-win32 as a console application.
The program took 10 hrs to crunch a particular batch of data. I also
compiled with Open Watcom 1.1 with similar results. However, I
compiled the program on Linux (I have a dual boot system) with gcc,
and it took 12 MINUTES to crunch the same data. Can someone answer:
where is my bottleneck on DOS?

I'm running the console as a DOS shell under Windows 98 on an Athlon
XP 1900+ with 512 MB ram. I'm only using the standard C libraries. My
config.sys file is empty. My Autoexec.bat file only contains PATH
information. Do I need to add lines for emm386, himem, and all that
rot? Or is it something else entirely? Please advise. Thanks.


Do you use int, short or long? Plain, near, far, huge pointers?


I'm using long int's and plain pointers.
Nov 13 '05 #8
"Brett" <ca******@yahoo .com> wrote in message
news:93******** *************** *@posting.googl e.com...
Michel Bardiaux <mb*******@peak time.be> wrote in message

news:<3F******* *******@peaktim e.be>...

[...]
Do you use int, short or long? Plain, near, far, huge pointers?


I'm using long int's and plain pointers.


Then, and assuming you compiled a (16-bit) DOS application, this is probably
where a lot of the difference lies. Your compiler is likely to produce much
slower 32-bit integer code for a 16-bit platform, and if your data pointers
are 'far', then pointer loads will be several times slower than your 32-bit
equivalent application.

Though I have to say that because you report such a huge speed difference,
that the DOS version is somehow I/O-bound (windows swap file?).

--
Jay

Jason Burgon. Author of Graphic Vision
Version 2.21 available from:
http://homepage.ntlworld.com/gvision

Nov 13 '05 #9
ca******@yahoo. com (Brett) wrote:
Hi. I wrote a program in C that spends most of its time doing integer
arithmetic (on a data set loaded at run time), with a negligible
amount of I/O. I compiled it with lcc-win32 as a console application.
The program took 10 hrs to crunch a particular batch of data. I also
compiled with Open Watcom 1.1 with similar results. However, I
compiled the program on Linux (I have a dual boot system) with gcc,
and it took 12 MINUTES to crunch the same data. Can someone answer:
where is my bottleneck on DOS?
Were you using lcc or Open Watcom for Linux? (I was under the
impression that OW was not yet working under Linux, though they are
trying to get it to work.)

Look. These days, gcc is *FAR* superior to either lcc or Watcom
C/C++. Lcc and Watcom C/C++ just clearly doesn't have anywhere near
the amount of work going into it that gcc has had in the last few
years. There are basically only 3 compilers left on the x86
environment where active development especially related to performance
is happening: MSVC++, GCC and Intel C/C++. Anything else is just a
joke (well maybe the Portland Group compilers, but there is very
little hard data on what they have been up to ...)
I'm running the console as a DOS shell under Windows 98 on an Athlon
XP 1900+ with 512 MB ram. I'm only using the standard C libraries.
Probably the saddest part of all of this is that Watcom's libraries
are just a joke. If you saw the same performance with lcc, then
there's a good chance that lcc's standard libraries are also a joke.
[...] My config.sys file is empty. My Autoexec.bat file only contains PATH
information. Do I need to add lines for emm386, himem, and all that
rot? Or is it something else entirely? Please advise. Thanks.


The old WATCOM C/C++ comes with an execution profiler (I don't know if
Open Watcom comes with it, I haven't been able to build it.) You can
use it to isolate where the performance bottleneck is. This, combined
with their excellent inline assembly mechanism, is the one saving
grace of WATCOM C/C++. So performance is still in your hands -- you
just can't rely on the compiler itself to deliver it for you.

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/
Nov 13 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
8800
by: zalekbloom | last post by:
I noticed on my PC with win98/IE 6.028 applets are not working. Applets are working when I use Netscape 7.1. When I open the DOS win and I check for a Java version I am getting: C:\WINDOWS>java -version java version "1.4.1_02" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06) On IE Tools-Internet option-Advanced- I see icon of Java (Sun) - checked.
1
2346
by: serpent17 | last post by:
Hello, Can python be installed on a win98 system ? if so, how do I control a qbasic program from python ? the qbasic program controls input to an RS-232 so I am enclined to follow the win98 system + qbasic route in order to be quick, or I guess the question could be, can I control a device through rs-232 from a newer version of windows using python (actually for the last part of the question I know this is feasible, but I 'd like to...
2
4836
by: GSpiggle | last post by:
Have recently upgraded to Windows XP and latest Access 2003 from Windows 98 and Access 97. Distribute a lot of front end applications linked to network based data files. During normal working hours the loading of forms and reports in design mode is slow; response time to keyboard/mouse commands is horrible. After network activity is slowed down, normal design reactions resume. Yes, I have refreshed the links in my applications. Have...
4
3520
by: JakeP | last post by:
how should you access the dos os from a c program whuch as djgpp? need to write an app that would for example get a list of all *.h files and store them in a linked list so the names need to be parsable...... seems straight forward on unix, but need to do it from a dos window on a win98 platform. cheers
10
3196
by: Jos Vernon | last post by:
I've been trying a mixed mode project but I'm having speed problems. I was using a DLL and linking into it from C#. I thought I'd try and stick the C# functionality and the raw unmanaged code into a mixed mode project. It works but it's incredibly slow. All the optimization settings are the same. All the code which was in the DLL is compiled with the /clr off. Only the bits which were in C# have been re-written in managed C++ (and I've...
8
1354
by: Paul Bromley | last post by:
I am about to release the second version of a program that I started writing 12 months ago. The first version worked fine on 98 upwards. This version seems to crash on Windows 98. I realise that this is a bit vague, but anyone any broad guidance as to how I might go about sorting this one?? To make matters worse, It seems to work fine on a Windows 98 machine home - loaded onto 2 at this other site with dotnet framework and it crashes. The...
0
1507
by: G Gerard | last post by:
Hello I have a network between three computers. On computer A the OS is win98, computer B and C have winXP. The backend of an MSAccess 2000 application is located on C and a copy of the front end is located on both A and B. When one of the front end is opened and connected to the backend on C the speed of the application is normal but when both front end (from A and B) are connected to the backend at the same time things slow down...
1
3109
by: giddy | last post by:
Hi , I've read this a long time ago , read it again: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_extending/context.asp I know how to make file associations and then add an option to the shell context menu if the user clicks that file. My application adds an extra option for .cs files.
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10156
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9951
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7375
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5419
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.