473,856 Members | 1,720 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 2925
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
8803
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
2354
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
4842
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
3531
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
3197
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
1356
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
1509
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
3112
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
9908
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
9760
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10379
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
7930
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
7090
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
5759
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4573
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
2
4172
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3198
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.