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

Bug: dm creation and group creation take ~500 milliseconds on Dev #1665

Open
cameronvoell opened this issue Feb 25, 2025 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@cameronvoell
Copy link
Contributor

Describe the bug

See re-creation here: #1656

Expected behavior

No response

Steps to reproduce the bug

No response

@cameronvoell cameronvoell added the bug Something isn't working label Feb 25, 2025
@cameronvoell cameronvoell changed the title Bug: dm creation and group creation take 500 milliseconds on Dev Bug: dm creation and group creation take ~500 milliseconds on Dev Feb 25, 2025
@cameronvoell cameronvoell self-assigned this Feb 25, 2025
@cameronvoell
Copy link
Contributor Author

cameronvoell commented Feb 25, 2025

Initial results on "why does creating a DM take ~450 milliseconds?"

get_membership_update_intent took: 149.325584ms

  • load_identity_updates=65.275791ms
  • calculate_membership_changes_with_keypackages=82.311ms

sync_with_conn completed in 313.081416ms

  • publish_intents succeeded, took: 145.227625ms
    • get_publish_intent_data: 73.69375ms
    • send_group_messages: 70.626667ms
  • receive succeeded, took: 77.732417ms
  • post_commit succeeded, took: 88.608041ms

Right now the main low hanging fruit I can look at that we seem to be calling get_installation_diff twice, once when constructing the intente for adding the other user to the DM, and then immediately after when publishing the intent. But otherwise no smoking guns here as the time seems evenly distrubuted across 6 discrete actions that are ~70-80ms each:

Function Related Network Call
load_identity_updates get_identity_updates_v2
calculate_membership_changes_with_keypackages get_key_packages_for_installation_ids
(publish_intents) get_publish_intent_data get_key_packages_for_installation_ids
(publish_intents) send_group_messages send_group_messages
receive query_group_messages
post_commit send_welcome_messages

Next step is to try and remove the extra get_key_packages_for_installation_ids, potentially by implementing a cache for fetching keypackages for installation keys, and then zoom out to see if there is anything else redundant that is occurring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant