slowness of Cpp::EnvironmentFile::merge

Milian Wolff mail at milianw.de
Tue Dec 21 15:50:35 UTC 2010


Hey all, esp. David:

According to this:
https://userpage.physik.fu-berlin.de/~milianw/callgrind.out.4728.bz2

the Cpp::EnvironmentFile::merge is responsible for 13.4% of the time spent 
parsing a part of boost (duchainify --force-update-recursive 
boost_1_45_0/libs/serialization/performance/xml/string256_test.cpp). Is this 
sane? I'll redo the callgrind in RelWithDebInfo soon but I hope we could 
improve that even now.

What I don't quite get are the lines like these:

  d_func_dynamic()->m_strings = (d_func()->m_strings + (file.d_func()-
>m_strings - d_func()->m_definedMacroNames)) - d_func()-
>m_unDefinedMacroNames;

Won't that lead to duplicated entries? Essentially that is:

A = (A + (A - B)) - C
  = 2 A - B - C

so all items in A not contained in B and C will show up twice (or the Set is 
indeed a Set and prevents that internally). Still, this should be faster and 
more clear, no?:

A -= B;
A -= C;

Bye
-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20101221/c5668129/attachment.sig>


More information about the KDevelop-devel mailing list