Quote:
Originally Posted by auspex
Vice versa, but you're right. Anybody who flat out states that if you want a program to run as fast as possible you use C++, (a) has never programmed in assembler and (b) doesn't understand C++. If I wanted to trim milli-seconds, I'd use C, not C++, but replacing every bit of Python in calibre with C++ would save you almost nothing.
|
First: You are probably not good enough in programming in assembler to best the compiler. The chance that you write better assembler than a current compiler is very slim.
Second: C++ is not slower than C. During compilation, almost all of the "sytactic sugar" that C++ provides is stripped out. Writing a program in C++ does not have a detrimental effect on speed, as long as you DON'T go and use some huge STL-objects that can do a lot of stuff and then compare it with a bare-bones implementation in C. For example, it's not really fair to compare a generic <List> with your own linked list implementation that only handles integers, and does only adding/removing entries.
Third: Why would rewriting Calibre in C or C++ gain nothing? I'm sure things such as the conversion process would become faster if rewritten in a compiled language.