Steps to reproduce:
- Create a group with 100k users
- Add another user to the group
Expected result: The mentions analysis is fast as there is nothing to analyze. Actual result: The mentions analysis task takes very long (several minutes at least). This is caused by the mentions analyzer doing a linear search for the existing objects in https://github.com/xwiki/xwiki-platform/blob/99353cb06bf62de1819d1bc5d757e881a3f35f38/xwiki-platform-core/xwiki-platform-mentions/xwiki-platform-mentions-default/src/main/java/org/xwiki/mentions/internal/analyzer/UpdatedDocumentMentionsAnalyzer.java#L204-L209 |