* RB Tree performance aspects in a map
@ 2008-01-05 17:20 Anitha Boyapati
0 siblings, 0 replies; only message in thread
From: Anitha Boyapati @ 2008-01-05 17:20 UTC (permalink / raw)
To: gcc-help
Hi,
This is more of analytical question. Perhaps someone can discern me when
an _Rb_Tree::find becomes expensive.
Going into details, I have a map<long, TestVec>. TestVec is a vector of
trees(once can think of a forest). So, I kind of insert this TestVec
rather heavily. This can be thought similar to inserting a single TestVec
for each instruction execution in a simulator of a cross compiler tool chain.
A profiling version shows that _Rb_Tree::find() is taking about 15% of the
time. As such this is a not a serious concern but it would be nice to know
more on factors that would affect balancing these Red Black trees.
One thought particularly influencing is operator<. When the key is a user
defined class object, obviously operator< impacts. My question is to what
extent can we expect inlining of operator< (if it gets inlined at all).
Probably, I have not asked right point about operator<. Various views on
this will be truly helpful.
--
Regards,
Anitha B
@S A N K H Y A
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-01-04 14:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-05 17:20 RB Tree performance aspects in a map Anitha Boyapati
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).