RE: Speed is important (was Re: Why We Should Use the STL (fwd))


Subject: RE: Speed is important (was Re: Why We Should Use the STL (fwd))
From: Bruce Pearson (BruceP@wn.com.au)
Date: Mon Jun 05 2000 - 05:16:42 CDT


Speed is important. Yes!

But...

Replacing UT_VECTOR class with STL vector would probably have no visible
increase in speed to the user. Speed improvement in a complex program like
AbiWord can only be done by carefully analysing the structure and the places
which are taking up processor time. Very often when you profile a section of
code it is usually the unexpected things that take up the majority of the
processing time. Trace through the code what happens when you press a key in
AbiWord. There is huge room for improvement. Runs get calculated multiple
times. Lines that don't change get erased and redrawn. etc....

Introducing STL just for speed improvements is a mistake. The main reason
for introducing STL and templates in general (which I have done in other
projects) should be for code reusability and programming robustness. Using
these technologies incorrectly by those that are new to them can cause major
problems. At times I've looked back at some of my early C++ code, before I
really understood the benefits of C++ and OOPs, and it makes me shudder.
Some of the code I've seen in this project is similar where you see things
like casts etc to get around the robustness and strict type checking of C++.

Personally I would love to use templates and STL on this project, but if it
goes against the design goals of a cross platform word processor, then I
vote we don't use them.

Bruce.



This archive was generated by hypermail 2b25 : Mon Jun 05 2000 - 17:24:43 CDT