UT_Vector IS slowing us down


Subject: UT_Vector IS slowing us down
From: Aaron Lehmann (aaronl@vitelus.com)
Date: Thu Jun 08 2000 - 01:33:33 CDT


At the advice of a few people on this list who know more about application
development than I do, I profiled AbiWord with a very simple test: typing
a paragraph full of 'a' 's. The results were pretty interesting.
pt_PieceTable::getSpanPtr gets called over 786,000 times during this
simple test, and it accounts for 6.87 percent of the time. And now, the
award for most-called function: UT_Vector::getNthItem, called over a
million times and accounting for 1.79 percent of the time the program took
to run.

I think a good way to optimize would be to prevent functions like
pt_PieceTable::getSpanPtr, PD_Document::getSpanPtr,
pt_VarSet::getPointer, pf_Frag_Text::getBufIndex, and
fl_BlockLayout::getSpanPtr from being called on the order of 800,000 times
for this simple test as they do now. AFAIK, the app really should not
need to get a span pointer almost a million times for inserting under
500 characters. Any ideas of how to go about doing this?

The report is far too large to post here. I put it up at
http://vitelus.com/aaronl/pub/abireport in case anyone is interested.
Beware, it's about 800k!

I realize that the test that I am doing as I profile AbiWord is pretty
stupid. It's meant to be extremely casual and just measure where the speed
goes when inserting and drawing characters. I'd be happy to accept
suggestions for other situations to profile. If anyone wants to try
profiling it themselves on unix, go to your platform-specific .mk file and
insert -pg into the compiler flags variables (make sure to do it for the
non-debug build to prevent debugging cruft from slowing it down). Then
make clean and recompile the whole thing without debugging. When you run
it, it should spit out a gmon.out file in the current directory. Run gprof
/usr/local/AbiSuite/bin/AbiWord_d (assuming that's where you have
abiword), and pipe its output to a file to recieve your report!

Hope this helps.

Aaron Lehmann



This archive was generated by hypermail 2b25 : Thu Jun 08 2000 - 01:33:37 CDT