region.removeAll(keys) is significantly slower than region.clear()
The observed performance difference is due to the intrinsic behavior of the two APIs:
region.clear() Internally optimized for clearing all entries at once.
Minimal messaging overhead across replicas.
Does not trigger per-entry events (e.g., cache listeners, indexes, WAN events).
Ideal for clearing all data from a region efficiently.
Refer to the official documentation: About Region.clear() Operations
region.removeAll(keys)Iterates through and removes each key individually.
Triggers per-key operations (destroy events, listeners, indexes).
Involves more inter-node communication and event propagation.
Performance depends on the number of keys and event processing overhead.
Refer to the official documentation: The removeAll Operation