> > There is no offense intended here. I have been programming for over > > 25 years (no brag, just fact). There is absolutely no way that C++ > > can solve a problem more efficiently (in terms of code and data space, > > and execution time) than plain ordinary C can. I have developed code > > on a lot of platforms (from mainframes(Honeywell/Bull, IBM down to > > micro-controllers (8052, PIC etc..) There is no C++ compiler in the > > world (AFAIK) that could generate code to run on an 8052 w/256 bytes > > of internal RAM, yet there are dozens of C compilers doing it. > > Granted, maintainability might be better on C++ (once you understand > > the crazy syntax) and type-protection is higher (because with bloated > > code and OOP it becomes more necessary). The bigger the beast, the > > harder to reign it in. I have seen small device C compilers generate > > tighter/faster code than a seasoned assembly programmer does. Of > > course the seasoned vet writes assembly code to be somewhat > > maintainable/understandable. Compilers never do. ;-)
> I like this post. I believe it is true. I have also been programming > for 25 years too, but I probably didn't improve after the first 5 > years of my career. However, i have learned to steal good ideas > judiciously in the ensuing 20 years. Do I write C and C++ ?? I have > written both kernels and network protocols in both languages. My > software, even the stuff written 25 years ago, still gets used.
> Unfortunately, when you criticize C++ in any way, in any forum, you > are preaching christianity to the muslims. Then you can sit back and > watch the sparks fly as these muslim C++ programmers impale themselves > on unsupportable statements about software engineering, compilers, > languages, complexity of large systems, etc.
You've hit the nail right on the head with this post! Good analogy too :).
> > Unfortunately, when you criticize C++ in any way, in any forum, you > > are preaching christianity to the muslims. Then you can sit back and > > watch the sparks fly as these muslim C++ programmers impale themselves > > on unsupportable statements about software engineering, compilers, > > languages, complexity of large systems, etc.
> You have just made the public confession of being a troll. Expect many > people to ignore you permanently.
> Bart.
Whats wrong Bart, have you recognized yourself in the above paragraph?
In article <3C90BC56.878E6...@hobbiton.org>, NotFound
<blas...@hobbiton.org> wrote: > > In other words, the standard library is faster than what we > > write. Thus a bigger standard library will lead to faster code. C++
> I disagree. The advantage of the standard library is not the speed at > runtime, is that it is already written and tested. The argument "You > can't write something equally fast" is only valid for beginners.
Can't there be more than one advantage to using the standard libraries over custom user code? I'm not sure what "the" advantage means, anyway.
Libraries allow increased resources to be invested in their production, due to a larger number of users (as compared to single-use non-library code). These extra resources can be used to make the library more robust, easier to use, more efficient, smaller, easily portable, etc.
The standard libraries are some of the most widely used, due to their inclusion with virtually every compiler. Since the interface is largely fixed, resources can go mainly to robustness and efficiency. I'd expect speed-critical portions of the standard libraries to be quite optimized. These include memory copy, basic string operations, freestore management, and I/O. Since the standard library is often supplied by the compiler vendor, architecture-specific optimizations are sometimes present (especially in the memory/string functions).
As far as writing something as fast as the standard library, the issue is the amount of efficiency you can get for a moderate cost. Given unlimited resources, you can compete with any library. Given a practical amount of resources, it's often a win to use the standard library.
> > I disagree. The advantage of the standard library is not the speed at > > runtime, is that it is already written and tested. The argument "You > > can't write something equally fast" is only valid for beginners. > Can't there be more than one advantage to using the standard libraries > over custom user code? I'm not sure what "the" advantage means, anyway.
Well, say the main advantage.
> The standard libraries are some of the most widely used, due to their > inclusion with virtually every compiler. Since the interface is largely > fixed, resources can go mainly to robustness and efficiency. I'd expect > speed-critical portions of the standard libraries to be quite optimized.
True, but many optimizations are of public knowledge and a motivated programmer can do the same.
> As far as writing something as fast as the standard library, the issue is > the amount of efficiency you can get for a moderate cost. Given unlimited > resources, you can compete with any library. Given a practical amount of > resources, it's often a win to use the standard library.
I agree with this, but i think the reason is more exactly than one can emply the time in optmize other parts of the program rather than on beat the standard library and possibly obtain more benfits.
> > > Unfortunately, when you criticize C++ in any way, in any forum, you > > > are preaching christianity to the muslims. Then you can sit back and > > > watch the sparks fly as these muslim C++ programmers impale themselves > > > on unsupportable statements about software engineering, compilers, > > > languages, complexity of large systems, etc.
> > You have just made the public confession of being a troll. Expect many > > people to ignore you permanently.
> Whats wrong Bart, have you recognized yourself in the above paragraph?
I couldn't care less for this debate, nor for your flamebait. Follow- ups set.
In article <3C93E9D0.AD9E2...@hobbiton.org>, NotFound
<blas...@hobbiton.org> wrote: > > > I disagree. The advantage of the standard library is not the speed at > > > runtime, is that it is already written and tested. The argument "You > > > can't write something equally fast" is only valid for beginners.
> > Can't there be more than one advantage to using the standard libraries > > over custom user code? I'm not sure what "the" advantage means, anyway.
> Well, say the main advantage.
I apologize for the above. I see your point. Having robust libraries is primary. They will be reasonably optimized anyway.
[snip]
> > As far as writing something as fast as the standard library, the issue is > > the amount of efficiency you can get for a moderate cost. Given unlimited > > resources, you can compete with any library. Given a practical amount of > > resources, it's often a win to use the standard library.
> I agree with this, but i think the reason is more exactly than one can > emply the time in optmize other parts of the program rather than on beat > the standard library and possibly obtain more benfits.
Good point. The implementor of the program has access to the "top" of the system, allowing them to optimize the hot spot wherever it is (if it's in the lib they can write an optimized replacement and use that). The implementor of the standard library can only meaningfully optimize when the hot spot lands in the library.
NotFound <blas...@hobbiton.org> writes: > > In other words, the standard library is faster than what we > > write. Thus a bigger standard library will lead to faster code. C++
> I disagree. The advantage of the standard library is not the speed at > runtime, is that it is already written and tested. The argument "You > can't write something equally fast" is only valid for beginners.
I agree with your statement that the main advantage of the standard library is its speed and its stability. But you cannot always write an equally fast alternative to its routines in standard C++, because they might be implemented in assembler. And hand-crafted assembler written by skilled programmers is still faster than most output of nowadays' compilers. The main problem is that the standard library is written specifically for a platform, while portable code isn't.
For an example, you can search this ng for a few hundred posts about 'FastString' by Peter Olcott. Although 99% if not more of those threads are total crap, one interesting fact which emerges is that Olcott's own standard C++ (or C for that matter) kind-of implementation was still quite a lot slower than the standard library's memcpy. This may be a function where optimization is especially important, but there are others as well. One example might be a deque, which is generally implemented as a bunch of blocks; those blocks might have a certain size due to the platform's memory access methods, which can not be detected by standard C++.
> I agree with your statement that the main advantage of the standard > library is its speed and its stability. But you cannot always write an > equally fast alternative to its routines in standard C++, because they > might be implemented in assembler. And hand-crafted assembler written
You cannot write it in standard C++, i agree, but out of this newsgroup (comp.lang.c++) is not the only way of write code ;) If the need for speed in important one can use platform especific extensions, assembler... and achieve the portability with conditional compilation for each platform required. That need time and resources and is not always an alternative, of course.
> For an example, you can search this ng for a few hundred posts about > 'FastString' by Peter Olcott. Although 99% if not more of those
Aaaaahhhh!!!! Please, not, i don't want to read Olcott's inevntions again :D
> library's memcpy. This may be a function where optimization is > especially important, but there are others as well. One example might
And there are others cases when not, i am sure. And in Olcott's threads I remember read apropos of std::string that specific specialization for basic_string<char> is not used almost in one compiler for the reason that stability is more important than speed for the customers. Then one cannot expect that the standard library is optimized in all cases.
> > I agree with this, but i think the reason is more exactly than one can > > emply the time in optmize other parts of the program rather than on beat > > the standard library and possibly obtain more benfits. > Good point. The implementor of the program has access to the "top" of the > system, allowing them to optimize the hot spot wherever it is (if it's in > the lib they can write an optimized replacement and use that). The
Exactly. The point "The standard library is fast enough" is a generalization but we can't forget the exceptions.
> > "Richard Heathfield" <bin...@eton.powernet.co.uk> wrote in message > > news:3C8F8ACE.9138276C@eton.powernet.co.uk... > > > As a proof, by the way, that MSVC++ is /not/ the most broken C++ > > > implementation, here's an even more broken C++ implementation:
> > Which is the broken compiler tha does not compile it?
> Itself.
> > > This implementation doesn't bootstrap well, of course.
> > What does "bootstrap" mean?
> In this context, bootstrapping is the "break-even" point for a compiler > - the point at which it can compile its own source code. Clearly, > LameC++ can't.
"Lame C++" can bootstarp because if does not compile it does not show the message. Did you mean that Lame C++ was previously built on some other compiler, because then the fault can be in the other compiler, so why blame Lame C++.
> > > In theory, no, it can't. In practice, yes, we must look at real world > > > implementations when discussing real world implementation issues. > > > Performance is not a language issue.
> > Lets decide first if we discuss for our PC or some embedded device.
> Well, that's up to the OP. He actually asked which was faster, C or C++. > IIRC he didn't specify platforms, implementations, or test programs. > Therefore, of course, the question is meaningless.
My main reason for asking was that Ioannis said that working with something called container or box[Sorry I forget these things] would @not@ make my code slower if instead I used the variable sized arrays of C99, I disagree mainly because it depends upon what I need, if I need only to have variable sized arrays, then they would under most circumstances provide better performence. What do you think? Also what about the virtual functions I hear that they make the performence slower.
[BIG SNIP]
> Remember those programs for printing a string in C and in C++? I tested > those for speed, using Cygwin's time utility, and found the C code to be > significantly faster. Try it yourself.
The equivalent of a code printing something like
#include <stdio.h>
int main() { printf("Choo Mantar");
}
in C++ would be
#include <cstdio> using std::cout
int main() { printf("Choo Mantar");
}
I have quite very much times considered using
std::cout << "This " << "is" << " ";
To be slower than
printf("This is ");
Thanks for showing. However how general is this observation?
> <snip>
> You've already said that no C++ code can be slower or bigger than the > equivalent C code, and I've already performed measurements which show > that that is not the case.
> APL is a programming language which uses its own weird character set - > it's intended for mathematicians, mainly, and is considered by many to > be a "write-only" language.
How do you define "Write-only" language.
P.S. I disagree with the type of arguments that you give like Zog C++ inserting a delay, it would be nice if you could not waste others time with these arguements. Thanks.
PPS Somewhere you mentioned that the only way to win this arguement is not to participate. I realised that and did not post[Frankly I had other reasons also], But what about you, you also seem to be with the stand that C is always faster than C++.
> > > "Richard Heathfield" <bin...@eton.powernet.co.uk> wrote in message > > > news:3C8F8ACE.9138276C@eton.powernet.co.uk... > > > > As a proof, by the way, that MSVC++ is /not/ the most broken C++ > > > > implementation, here's an even more broken C++ implementation:
<Snip>
> > > > This implementation doesn't bootstrap well, of course.
> > > What does "bootstrap" mean?
> > In this context, bootstrapping is the "break-even" point for a compiler > > - the point at which it can compile its own source code. Clearly, > > LameC++ can't.
> "Lame C++" can bootstarp because if does not compile it does not show > the message. > Did you mean that Lame C++ was previously built on some other > compiler, because then the fault can be in the other compiler, so why > blame Lame C++.
Don't blame the other compiler either, blame those who developed Lame C++.
I don't get it, any fault found in something I produce I can blame on the development tools. How then do I react to accolades?
> "Lame C++" can bootstarp because if does not compile it does not show > the message. > Did you mean that Lame C++ was previously built on some other > compiler, because then the fault can be in the other compiler, so why > blame Lame C++.
That's a good theory. :)
> My main reason for asking was that Ioannis said that working with > something called container or box[Sorry I forget these things] would > @not@ make my code slower if instead I used the variable sized arrays > of C99, I disagree mainly because it depends upon what I need, if I > need only to have variable sized arrays, then they would under most > circumstances provide better performence.
C++ containers aren't slower, the only thing they have is space cost. They do hot have time cost because their member functions are inlined. An example, std::string vs char * in my tests:
> What do you think? > Also what about the virtual functions I hear that they make the > performence slower.
They have a slightly more cost than conventional member functions but in the context they are used that is expected anyway (e.g. the example of Richard Heathfield where he said he likes to store keeping information himeself).
> > Remember those programs for printing a string in C and in C++? I tested > > those for speed, using Cygwin's time utility, and found the C code to be > > significantly faster. Try it yourself.
> The equivalent of a code printing something like
> #include <stdio.h>
> int main() > { > printf("Choo Mantar"); > }
> in C++ would be
> #include <cstdio> > using std::cout
> int main() > { > printf("Choo Mantar"); > }
> I have quite very much times considered using
> std::cout << "This " << "is" << " ";
> To be slower than
> printf("This is ");
> Thanks for showing. However how general is this observation?
From my measurements i have found no additional time cost between cout in printf in both my compilers.
> PPS Somewhere you mentioned that the only way to win this arguement is > not to participate. I realised that and did not post[Frankly I had > other reasons also], But what about you, you also seem to be with the > stand that C is always faster than C++.
See it from a philosophical view. Almost the whole C89 is a subset of C++, so how can it be faster than C++? :)
>> > and MINGW32's clock_t is msecs so they have indeed the same speed.
All that you have shown is that both methods of doing output take less than the minimum measureable about of time on your system. Frankly, I wonder how anyone is supposed to take your arguments seriously when you are measuring the speed of a single function call in milliseconds. To do a more meaningfull test, either use the Pentium's timestamp counter, or measure multiple function calls; better yet use both. -- ________________________________________________________________________ Dipl.-Ing. Eric Doenges http://www.rcs.ei.tum.de Institute for Real-Time Computer Systems (RCS) fon +49-89-289-23590 Technische Universitaet Muenchen, D-80290 Muenchen fax +49-89-289-23555
> > This is really an implementation issue, but the speed cost comes from > > the fact that the template code is effectively duplicated for each new > > parameterised type you use in your program, thus increasing the code > > size and thus increasing the likely frequency with which the operating > > system will have to swap out parts of your program so that it can fit > > other parts into memory. This is a general cost of inlining, and applies > > just as much to C as it does to C++. Consider this (horrible) macro:
> > #define is_odd(t, n) int n(t i) { return i % 2 == 1; }
> Inlining is not the same as template instantiation.
No, although they have certain characteristics in common.
<snip>
> I'll come back to inlines in a moment. With templates, you only get > one specialised version of a templatised class or function per type, > no matter how many times each type is used.
I know, but of course you *do* get one separate specialised version for each *type*, which was all I intended to claim. My apologies if I didn't put it clearly enough.
> > In this context, bootstrapping is the "break-even" point for a compiler > > - the point at which it can compile its own source code. Clearly, > > LameC++ can't.
> "Lame C++" can bootstarp because if does not compile it does not show > the message.
If it can't compile itself, it can't bootstrap. And it's quite clear that it can't compile itself.
> Did you mean that Lame C++ was previously built on some other > compiler, because then the fault can be in the other compiler, so why > blame Lame C++.
Your question is based on such a fundamental misunderstanding of my original point that it's hard to know where to begin answering. Instead, allow me to re-state the original point.
Ioannis Vranos claimed that MSVC++ was the most broken C++ compiler out there (or some similar words). I showed him that this is not true, by providing an example of an even more broken C++ compiler - one that is so broken it can't even compile a single C++ program. The bootstrapping joke was just that - a joke.
> > > > In theory, no, it can't. In practice, yes, we must look at real world > > > > implementations when discussing real world implementation issues. > > > > Performance is not a language issue.
> > > Lets decide first if we discuss for our PC or some embedded device.
> > Well, that's up to the OP. He actually asked which was faster, C or C++. > > IIRC he didn't specify platforms, implementations, or test programs. > > Therefore, of course, the question is meaningless.
> My main reason for asking was that Ioannis said that working with > something called container or box[Sorry I forget these things] would > @not@ make my code slower if instead I used the variable sized arrays > of C99, I disagree mainly because it depends upon what I need, if I > need only to have variable sized arrays, then they would under most > circumstances provide better performence. > What do you think?
I think that the question is flawed. The speed of your program depends far more on your choosing appropriate algorithms and implementing them well, than it does on your choice of language. Choose the language you like best, but don't try to pretend that it's faster, or slower, than the alternative choice.
> Also what about the virtual functions I hear that they make the > performence slower.
If you choose the right algorithms, the performance hit of virtual functions is unlikely to be significant enough to matter.
<snip>
> How do you define "Write-only" language.
A language in which typical programs are very hard to read.
> P.S. I disagree with the type of arguments that you give like Zog C++ > inserting a delay, it would be nice if you could not waste others time > with these arguements. Thanks.
My point in using that illustration was that implementations, not languages, determine performance. If you don't want to hear the answer, don't ask the question.
> PPS Somewhere you mentioned that the only way to win this arguement is > not to participate. I realised that and did not post[Frankly I had > other reasons also], But what about you, you also seem to be with the > stand that C is always faster than C++.
No, I take the position that implementations, not languages, determine performance, but that there are some aspects inherent in C++ which will tend to make it marginally slower than C in some circumstances. Conversely, there are some situations in which C++ will be faster. It depends on many factors, of which the overwhelming ones are (1) the program and (2) the implementation. Your choice of language matters much less than either of these two factors.
A thread has been cross-posted on four groups on the subject of C or C++. As I'm only writing as an embedded programmer, I wanted to avoid adding to that cross-posting fray. I'm posting this only in CAE.
I should say what my biases are before I speak. I'm not a C expert, though I've been using C since 1978 and have written a working, toy C compiler. I'm not a C++ expert, though I've been using C++ since 1989 for Windows programming.
What I care about is very different from what many C++ programmers care about, because my area of designing and coding small embedded systems does NOT include any Windows or Linux programming. (That is not to say I don't program on Windows or Linux, just that I don't program them for embedded products.) And keep in mind that I'm talking about only one facet of my programming experience -- the embedded facet. And that my embedded universe is NOT the same as the embedded universe as a whole -- again, it is only a subset of that, too.
I'm very interested in using C++ in my projects. I'm just quite skeptical, for a variety of reasons, about using one.
My World and Welcome To It --------------------------
My world includes processors with as little as 500 instructions of code space, or so. Some of my applications only require 1/10th of that, to be honest. I rarely, very rarely get to use a processor with more than 32k instructions available. The RAM is often limited to a few tens of bytes and rarely gets more than 2-3k byte. I'm currently working on several projects: one with 512 words of code space and 128 bytes of ram; one with 16k word of code space and 1500 bytes of ram; and one with 1/2Mb of code space and 1/8Mb of ram. This isn't an unusual mix or me.
For the most part, my applications are sensitive to cost, power, board space, radiated EMF, and so on. In part, that means in some cases that an additional $20 in the CPU section makes the difference between having a product which succeeds and having a product no one buys, even if everything else is just fine.
Now for the smaller CPU environments, I usually use assembly, because those applications often have extremely tight requirements. I may need to count cycles to make certain that either path across a branch boundary takes the same cycle count, for example. Further, the application design is the big part of it and the coding time is rather small by comparison. So the issue of "faster coding" doesn't really come into place as much on these smaller systems. For the larger applications, I often use C, mixed with assembly.
I can't afford templates, if instantiating support for a data type causes functions I don't actually use to be generated and linked, for example. I can't afford exception handling, if the compiler still generates defensive code even when I don't use any syntax in my code for them.
For the greater part, well-optimized and well-designed libraries buy me exactly zilch for my applications. That's not entirely true, of course. Floating point libraries, for example, can be quite useful. But by and large, libraries either aren't re-entrant; they make assumptions which aren't true in my environment; they provide far too many features and I have no choice but to include them all or use none of them; and so on. So talking about the benefits of C++ libraries, templated or otherwise, makes little headway with me. At least, that's how it has been so far for me.
I don't have a purchased operating system, I write my own. I don't have a supplied library, I write my own. I do care about ram usage, stack usage, and program space. I care a great deal about partial template specialization in C++, but I wouldn't care much about access to large, standard template libraries.
I care a great deal about having control over the processor I work on. I care most of all in knowing exactly what kind of code is generated by the compiler I use for syntax I write. I need to have an intuitive understanding of what happens for each and every line of source code I lay down, when I'm writing it.
How many people using C++ know exactly how the vtable mechanism works? In the face of multiple inheritance? With virtual base objects? How many people how a C++ compiler supports dynamic casts or know what causes the C++ compiler to generate (or not generate) support for it? What mechanism does a C++ compiler use for exception handling? What does it cost? Where? If one stays away from a mechanism, how much of it is still present?
I need to know what is generated, time and again. In short, my focus is exactly on the compiler itself and my ability to know what it does. For folks working on large systems, it's enough for them to know that it "doesn't cost much." For me, cost isn't just a little bit of code space, a little bit of ram space, and a little bit of execution time. Sometimes, it's not a matter of degree, but a matter of YES/NO, GOOD/BAD, WORKS/DOESN'T WORK. I can't leave these details as some abstract matter of implementation I can ignore. Often, the compiler makes decisions about "what's works for non-critical situations" because that is where many of the applications are at.
But that's not where MY applications are at. All the details must be well understood. The compiler itself and the linker support is my main focus. Not the libraries.
Hopefully, that gives an idea of where I'm coming from to those who use C++ as part of their application development on systems where the equivalent transistor count is measured in the 100's of millions or billions. I just don't live in their world.
So I'm speaking as one who uses assembly and C for their current embedded applications and who would enjoy using a subset of C++. But I also have some concerns, too.
C++ as a Superset of C ----------------------
Strictly speaking, C++ is not a superset of C. If unsure of that fact, pages 816 to 818 in Stroustrup's 3rd edition of "The C++ Programming Language" indicates that some ANSI C programs are not valid C++ and includes examples, as well. But for many practical purposes, developing new source code for C++ looks about like working with a superset of C.
But it is the object code generation that is more the question mark for an embedded programmer. Not so much the source code input to the compiler.
C++ Exception Semantics -----------------------
For embedded use, this is an area which worries me where separate compilation is supported (which it is, in every case I am aware of.)
I know. Most folks just say, "Well, don't use exceptions then." But a properly functioning C++ compiler, it seems to me, must generate correct code for source code unit A when it has absolutely no idea what kind of exception handling may be required in source code unit B, compiled separately and perhaps at a very different time. And I have absolutely no confidence at all that the linkers available to an embedded programmer will cover over the problem I'm about to illustrate here.
Take this sequence of code, found as part of some function in some source code file: . . foo (); String s; foo (); . .
For purposes of discussion, assume this fragment occurs as part of a routine that doesn't use try..catch at all in a source code module that doesn't use try...catch or declare any throws, either. In fact, assume the module was written almost like C code by someone who wasn't thinking about or worrying over exceptions at all. It might even be a C source code file modified slightly to take advantage of a few C++ features, such as the String class.
Also, for purposes here, assume that foo() is an external procedure and that the compiler has a declaration for it, but does not know its definition.
The C++ compiler, being a smart and proper C++ compiler, sees the first call to foo() and can just allow a normal stack unwind to occur if foo() throws an exception. In other words, no extra code is needed at this point to support the unwind process. But once String s has been created, the C++ compiler knows that it must be properly destroyed before an unwind can be allowed if an exception occurs later on. So the second call to foo() is semantically different from the first. If the 2nd call to foo() throws an exception (which it may or may not) in foo(), the compiler must have placed code designed to handle the destruction of String s before letting the usual unwind occur.
Now, the above is a case where a common, garden variety embedded programmer would imagine that the two calls to foo() would take the same time, require the same resources, and otherwise be the same. Most programmers I know would believe and defend that position, even when told that instead of a C compiler it is a C++ compiler looking at the source code. Even the more sensitive thinking programmers who are aware of exception handling, stack unwinding, and so on, would tend to pause for a while when faced with a source file which quite simply contains NO try..catch blocks, no throws, and otherwise completely avoids any use of C++ syntax related to exceptions.
Yet the C++ compiler *must* be aware of the difficulties and *must* generate different code in these cases, where foo() is permitted to generate exceptions. And without an empty throw clause in it's declaration, the C++ compiler must assume that it may.
All this, in a snip of code in a function in a module none of which has any syntax dealing with exceptions at all.
Now, I know it is possible to declare foo() with a throw in the declaration so that the compiler knows it cannot throw an exception. The compiler may be able to do better, in code generation in such a case where careful, explicit attention has been given to the function declarations. But in reality, in embedded systems trying to make th transition to using C++ with programmers learning to use C++ features and perhaps modifying existing code to be compiled with a C++ compiler, this is
...
> >> > and MINGW32's clock_t is msecs so they have indeed the same speed.
> All that you have shown is that both methods of doing output take less > than the minimum measureable about of time on your system. Frankly, I > wonder how anyone is supposed to take your arguments seriously when > you are measuring the speed of a single function call in milliseconds. > To do a more meaningfull test, either use the Pentium's timestamp > counter, or measure multiple function calls; better yet use both.
> Ioannis Vranos claimed that MSVC++ was the most broken C++ compiler out > there (or some similar words). I showed him that this is not true, by > providing an example of an even more broken C++ compiler - one that is > so broken it can't even compile a single C++ program. The bootstrapping > joke was just that - a joke.
Well, next time don't chalenge if VC++ is not the most broken compiler. You are going against common sense. :P Seriously speaking i said that as an exaggeration, just don't comment on ANSI C++ code that it doesn't compile under VC++. :)
>"Dan Pop" <Dan....@ifh.de> wrote in message >news:a6stnt$cmo$1@sunnews.cern.ch... >> In <Xns91D19C8786B11dlev...@199.45.49.11> Dave Levitt ><dlev...@munged.bellatlantic.net> writes:
>> >The original IBM PC [model 5100] had 64k or ram, an audio tape driver
>> >When you added a floppy or two, these these [disk] operating systems >were >> >available:
>> You also needed the 64k of RAM for them.
>> This could explain why IBM's decision to limit the system's RAM to >640k >> actually made sense at the time. Such a limitation was unavoidable, >> anyway (only the actual value could have been different, but not much >> higher than the famous 640k).
>Wasn't the 640k limit so that they could put video RAM and ROM space for >peripheral boards into the 1MB that the 8088 could address?
This was the purpose of the limit and the reason it was unavoidable. The only question left open was the actual value of the limit. IBM chose a limit that was 10 times higher than the maximum memory capacity of the computer's system board. Doesn't look unreasonable to me.
Dan -- Dan Pop DESY Zeuthen, RZ group Email: Dan....@ifh.de
In <OInk8.1$JX3.4...@typhoon.southeast.rr.com> "Keith Brafford" <kbraff...@nc.rr.com> writes:
>"Steve Wheeler" <swheeler...@earthlink.net> wrote in message news:NBnk8.17405$P4.1496522@newsread2.prod.itd.earthlink.net... >> Wasn't the 640k limit so that they could put video RAM and ROM space for >> peripheral boards into the 1MB that the 8088 could address?
>No. 640K was the limit because Bill Gates said that was all >we'd ever need *jk* :-)
>I've always felt that 640K was a reasonable limit based on the >cascaded effect of 3 different companies' work on the PC.
>Microsoft gave us that limit because IBM put a whole bunch of >memory-mapped hardware (video, BIOS stuff, etc.) up high >in 1MB that the PC could address.
Microsoft gave you no limit: the limit was already there, in the hardware.
>IBM put that stuff there because they chose the Intel 8088, >which had its reset vector at the high end of things and needed >the bottom part of memory for the interrupt vector table.
Well, having the reset vector at the end of the address space was a good design decision. I've seen 8-bit systems having it at address 0 jumping through hoops so that they could have their ROMs at the end of the processor's address space. CP/M-80 anyone?
Regardless of this issue, the limit had to be there, some place, because the 1 MB of the processor address space had to be divided between system RAM and BIOS (system & peripheral extensions) + extension cards RAM (frame buffers, disk buffers, network card buffers, expanded memory cards address space).
>So I blame Intel :-)
The blame should go to IBM for choosing a 16-bit processor with a horrible ISA and an 8-bit external interface. I don't know if the 68000 was shipping in quantity at the time the decision was made, but it should have been the obvious choice.
Dan -- Dan Pop DESY Zeuthen, RZ group Email: Dan....@ifh.de
> In <OInk8.1$JX3.4...@typhoon.southeast.rr.com> "Keith Brafford" <kbraff...@nc.rr.com> writes:
> The blame should go to IBM for choosing a 16-bit processor with a > horrible ISA and an 8-bit external interface. I don't know if the 68000 > was shipping in quantity at the time the decision was made, but it should > have been the obvious choice.
I did see an article a while back that claimed the choice of the 8088 was made because it would interface relatively easily to the existing 8080/8085 support chips, whereas the 68000 although a superior design either didn't have necessary support chips available, or the cost of interfacing to them was considered too expensive.
"Dan Pop" <Dan....@ifh.de> wrote in message news:a751j1$7up$1@sunnews.cern.ch... > This was the purpose of the limit and the reason it was unavoidable. > The only question left open was the actual value of the limit. IBM chose > a limit that was 10 times higher than the maximum memory capacity of the > computer's system board. Doesn't look unreasonable to me.
Sure 10x memory is an order of magnitude; sounds reasonable...until you realize that 10x is only about 4.75 years worth of memory growth according to Moore's Law!
> > This was the purpose of the limit and the reason it was unavoidable. > > The only question left open was the actual value of the limit. IBM chose > > a limit that was 10 times higher than the maximum memory capacity of the > > computer's system board. Doesn't look unreasonable to me.
> Sure 10x memory is an order of magnitude; sounds reasonable...until > you realize that 10x is only about 4.75 years worth of memory growth > according to Moore's Law!
> In <OInk8.1$JX3.4...@typhoon.southeast.rr.com> "Keith Brafford" <kbraff...@nc.rr.com> writes: > >So I blame Intel :-) > The blame should go to IBM for choosing a 16-bit processor with a > horrible ISA and an 8-bit external interface. I don't know if the 68000 > was shipping in quantity at the time the decision was made, but it should > have been the obvious choice.
Well, in those days the 68000 were shipped by the dozen in the Netherlands. I remember a TNO box running (those were the days) a unix version 6 os on a single 68K and some mysterious backup 68K running one step behind (and I mean one _clock_ step behind) just because it wasn't possible to get a decent MMU cooperating with the 68K in those days ...
IIRC no MMU could solve those problems because something really bad happened inside that 68K when a page fault was detected. I (luckily) forgot the details though ...