[EMAIL PROTECTED] writes:

> I have a call to hash_map::clear() function which takes long time.

It is somewhat likely that you are mis-interpreting the results
that you observed.

It is hard to imagine a situation in which creating a hash_map
takes less time than clear()ing it.

Using g++4.0.0, creating a 10,000,000 entry hash_map takes 116
seconds on my machine; clearing via either clear() or swap() with
temporary takes 8 seconds.

> Now runtime drops significantly, 10 fold less.
> What's exactly cause this run time reduction?

User error, most likely.

If you are convinced that you really see what you claim to see,
post a complete compilable test case that demonstrates that.

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to