Description
Importing content with the Oak XML ImportHandler makes quite heavy use of namespaces and results in frequent calls to Namespaces.getNamespaceMap(). Most of the time the complete namespace map is not actually needed and only a single mapping is requested. This adds quite some overhead, which we can easily avoid. The JCR specification says (3.5.1):
The local namespace mapping of a session is determined by the initial set of mappings copied from the namespace registry and any session-local changes made to that set.
Right now we don't have this initial set, but always ask the namespace registry.
I suggest we copy the mappings on first usage and work with this copy.