Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve mass notification processing #1154

Merged

Conversation

nickvergessen
Copy link
Member

Steps

  1. Create 70 users:
i=10
while [ $i -ne 70 ]
do
        i=$(($i+1))
        echo "$i"

	USERID=$(uuidgen)
	OC_PASS="123456" occ -vvv user:add --password-from-env --display-name "Dummy #$i" -g "dummies" $USERID
	occ -vvv user:setting $USERID settings email "test$i@yourdomain.tld"

done
  1. Create a conversation as admin with group "dummies"
  2. Start a call
  3. Measure time around the section in talk:
    https://github.com/nextcloud/spreed/blob/1aaf10e2653e764ed54a6abc9eac750753263a3c/lib/Notification/Listener.php#L234-L253
			// Add this after https://github.com/nextcloud/spreed/blob/1aaf10e2653e764ed54a6abc9eac750753263a3c/lib/Notification/Listener.php#L233
			$start = microtime(true);
			// Add this before https://github.com/nextcloud/spreed/blob/1aaf10e2653e764ed54a6abc9eac750753263a3c/lib/Notification/Listener.php#L255
			$end = microtime(true);
			\OC::$server->getLogger()->error('notify: ' . ($end - $start));
  1. Measure the patch again with the beginTransaction and commit being commented out
With patch Without patch
~0.01s ~0.5s

@nickvergessen
Copy link
Member Author

/backport to stable23

@nickvergessen nickvergessen force-pushed the techdebt/noid/improve-mass-notification-processing branch from 49c81d8 to aa454f0 Compare February 24, 2022 10:58
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen force-pushed the techdebt/noid/improve-mass-notification-processing branch from aa454f0 to 240a5cd Compare February 24, 2022 15:12
Copy link

@vitormattos vitormattos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good!
I liked the usage of array_chunk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants