just fwiw. Loading a 205 pages document takes ~2 minutes. That sucks. Here's what gprof has to say:
% cumulative self self total time seconds seconds calls ms/call ms/call name 12.28 5.70 5.70 UT_StringPtrMap::find_slot(UT_String const &, UT_StringPtrMap::SM_search_type, unsigned int &, bool &, unsigned int &, void const *, bool *, void *, unsigned int) const 10.68 10.66 4.96 UT_String::UT_String(char const *, unsigned int) 6.98 13.90 3.24 hashcode(UT_String const &) 3.51 15.53 1.63 UT_StringPtrMap::pick(char const *) const 3.25 17.04 1.51 UT_Stringbuf::UT_Stringbuf(char const *, unsigned int) 3.12 18.49 1.45 2675812 0.00 0.00 fp_Run::updateHighlightColor(void) 3.06 19.91 1.42 UT_String::c_str(void) const 2.74 21.18 1.27 UT_StringPtrMap::pick(UT_String const &) const 2.43 22.31 1.13 operator==(UT_String const &, UT_String const &) 2.37 23.41 1.10 6441199 0.00 0.00 PP_evalProperty(char const *, PP_AttrProp const *, PP_AttrProp const *, PP_AttrProp const *, PD_Document *, bool) 2.37 24.51 1.10 UT_String::~UT_String(void) 1.96 25.42 0.91 447093 0.00 0.00 UT_contextGlyph::renderString(unsigned int const *, unsigned int *, unsigned int, unsigned int const *, unsigned int const *) const 1.81 26.26 0.84 s_compare(void const *, void const *) 1.66 27.03 0.77 2909483 0.00 0.00 pt_PieceTable::getSpanAttrProp(void const *, unsigned int, bool, PP_AttrProp const **) c As you see, the hash table takes all the time. I'm not suspecting the hash table implementation itself -- but I guess that a COW and a "little strings" optimizations to UT_Stringbuf (removing the mutable [] operator of UT_String before) would improve quite a bit these figures. It's just that we're calling too much these functions. I've seen that when I was debugging the fonts code, the layout is trying to access several times the same font (I don't remember how many times per character written, but it was > 1). If I discover some stupid bottleneck I will try to fix it and email some patches. Cheers, -- Joaqu�n Cuenca Abela [EMAIL PROTECTED]
