What steps will reproduce the problem?
1. Use mod_pep (+ variant in 0.11+)
2. Have a few PEP nodes
3. Receive presence from contacts
What is the expected output?
Should be fast and efficient.
What do you see instead?
Lots of storage requests, very slow.
What version of the product are you using?
0.11.x
Please provide any additional information below.
When receiving presence from contacts, mod_pep updates their subscriptions based on caps / disco#info.
Each time it adds or removes a subscription, the node configuration is saved (but presence based subscriptions are filtered out), so generally the existing data is simply replaced with identical data.
In summary: O(n) storage accesses for no reason.
What steps will reproduce the problem? 1. Use mod_pep (+ variant in 0.11+) 2. Have a few PEP nodes 3. Receive presence from contacts What is the expected output? Should be fast and efficient. What do you see instead? Lots of storage requests, very slow. What version of the product are you using? 0.11.x Please provide any additional information below. When receiving presence from contacts, mod_pep updates their subscriptions based on caps / disco#info. Each time it adds or removes a subscription, the node configuration is saved (but presence based subscriptions are filtered out), so generally the existing data is simply replaced with identical data. In summary: O(n) storage accesses for no reason.
Have a patch
ChangesFixed in https://hg.prosody.im/timber/rev/045209b41b3a Please test
ChangesReverted in https://hg.prosody.im/trunk/rev/6714578cfd6e due to a regression.
ChangesAttempt number two in https://hg.prosody.im/trunk/rev/225fade2ab4d
Changes