Skip to content

Conversation

SessionHero01
Copy link
Collaborator

@SessionHero01 SessionHero01 commented Feb 11, 2025

This is an experimental PR that tries to replace okhttp with ktor as our main http library.

This is due to the thread model used in okhttp isn't scalable: it's a blocking thread based model. This means that if you happen to have 100 groups you'll likely end up with 100 threads while they are all polling at the same time. If you limit the thread number, all threads will be blocked busy waiting for the http polling and leave no rooms for other operations.

In contrast, ktor/cio uses a selector model which can scale up network concurrency almost limitedlessly(* still subjects to system resources but no threads are created as the number of connection increases).

This PR is here so that people can try out if it makes any significant performance improvement, particularly when you have large number of groups (for a small number of groups it's expected to not have any advantage).

TODO list:

  • Certificate pinning not working
  • Rewrite the inflexible implemention of ProfileCipherInputStream where it assumes things about a particular cipher. This "particular cipher" has to be removed so that ktor/tls works.
  • Replace other usages of okhttp
  • Remove okhttp altogether

@SessionHero01 SessionHero01 marked this pull request as draft February 11, 2025 23:42
ThomasSession and others added 29 commits July 24, 2025 17:20
…in-translations

[Automated] Update translations from Crowdin
SES-4107 : Non-voicenote audio attachments are not treated as attachments
SES-3437 : Community Mentions Inconsistent
ThomasSession and others added 30 commits August 19, 2025 16:29
SES-4362 : Unread and mention indicators lose their values in RTL
…in-translations

[Automated] Update translations from Crowdin
…in-translations

[Automated] Update translations from Crowdin
…in-translations

[Automated] Update translations from Crowdin
# Conflicts:
#	app/build.gradle
#	app/src/main/AndroidManifest.xml
#	app/src/main/java/org/session/libsession/snode/SnodeAPI.kt
#	app/src/main/java/org/session/libsession/utilities/Util.kt
#	app/src/main/java/org/thoughtcrime/securesms/ApplicationContext.java
#	app/src/main/res/xml/network_security_configuration.xml
#	gradle.properties
#	libsignal/build.gradle
#	libsignal/src/main/java/org/session/libsignal/streams/ProfileCipherInputStream.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants