Registering cleaners takes up resources and currently bumps into a global lock. The native map code is registering a cleaner for iterators, even in the case where the native code did not allocate an iterator. This code is called very frequently by scan threads.
This change does not register the cleaner in the case where the native code did not allocate a native iterator. This should cause less contention between scan threads that are unrelated to each other.
Registering cleaners takes up resources and currently bumps into a global lock. The native map code is registering a cleaner for iterators, even in the case where the native code did not allocate an iterator. This code is called very frequently by scan threads.
This change does not register the cleaner in the case where the native code did not allocate a native iterator. This should cause less contention between scan threads that are unrelated to each other.