I smell an EECS 281 Project here
For reference when I was an IA for this class, I got a lot of questions about this. This just means that a lot of your time has been spent in the internal methods of the map type. Try and cut down on expensive copies and repeated find operations. If you are accessing the map over and over again like the following code
if (m[key].something) {
use(m[key]);
cout << m[key];
}
try and change it to
auto& value = m[key];
if (value.something) {
use(value);
cout << value;
}
This will help you go from 3 expensive find operations to just 1. You can imagine how this can be helpful when you access a map lots of times in a loop.
Also take a look at Can the use of C++11's 'auto' improve performance? and make sure you are not making mistakes like that.