[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Time to rewrite dpkg IN IDL! :)



On Fri, May 21, 1999 at 12:27:32AM +1000, Craig Sanders wrote:
> 
> C++ may be OO, but it's not very good OO....and it tends to compile into
> code which is both bloated and slow.
> 
> dpkg is already far too slow on old hardware...hell, it's too slow on
> a P200 with 200MB of RAM, now that the status and available files have
> over 3300 packages detailed in them.

Yeah, it's slow, and it's written in C.

And you want to cinvince me by your un-emotional argumentation that it will
be even slower in C++?

Strange. Last time I took a look at Stroustrups language it seemed that it
would be carefully designed to not enforce too much overhead on language
features, and no overhead on language features not used. Stroustrups book
goes into detail, and always mentions which run time overhead you have to
expect when you use a certain language feature. Most features are only one
function call away.

Exceptions are the single exception. Use of them will reduce the amount of
code you have to write, and improves error handling drastically. Some
functions that have a lot of error conditions to check that are fourty lines
of C code with deep nesting are reduced to four or five lines of flat C++
code.

The speed of dpkg has little to do with the language (as long as you use a
compiled and not interpreted language). The number of packages is the cause
of the speed problem, and the involved algorithms (parsing the ASCII file
and putting it into a data structure). I am sure there is really room of
improvement here.

Picking one compiled language in favour of another for speed consideration
but ignoring things like maintenability and development of code looks
simple-minded to me. The difference in speed will be unnoticable if the same
algorithms are used.

Marcus

-- 
"The purpose of Free Software is Free Software.
The End and the Means are the same."  -- Craig Sanders

Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>


Reply to: