Are you sure that std::unordered_map<int, std::unordered_map<int, ElementType> > is the best choice? If you tell us the problem you want to solve someone might be able to recommend better ways.
Or if the range of your ints is small enough, you could create a single int out of them. E.g., if the ints are called x and y and the range of each is 0 to 999, you could use the key x * 1000 + y.
Or if the ints are 32 bits you could stuff them into a 64 bit integer.
unrelated but destroying things, and creating them, is often expensive if you do it over and over, eg in a loop, or a loop that calls a function that does these things.
finding a way to not create/destroy too much can give large rewards.
Every advice is useful for me.
It is interesting about polymorphic memory resource, which is new to me and I do not know it is standard.
(But, my compiler seems not to recognize it even though partially C++17 supports)
But, I understand that memory pool reserved in the previous stage works well,
thank you so much for your cooperation.