From 08bd34598718deda0e89498cbbd3dace6bfa8717 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Thu, 7 Jan 2021 19:18:45 +0100 Subject: [PATCH] Change default values of experimental options --- README.md | 19 +++++++++---------- td/telegram/ContactsManager.cpp | 2 +- td/telegram/FileReferenceManager.cpp | 2 +- td/telegram/MessagesManager.cpp | 2 +- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index b01275190..4e7effa93 100644 --- a/README.md +++ b/README.md @@ -18,19 +18,18 @@ TDLight if used with care doesn't grow in memory usage with time. Look at **TdAp ### Custom options We added some options: -* **disable_minithumbnails** (true/false) This setting removes minithumbnails everywhere. It reduces memory usage because tdlib keeps them in RAM. -* **disable_document_filenames** (true/false) If you don't care about having the original filenames of every file stored in RAM, you can disable them using this option. It reduces memory usage. -* **disable_notifications** (true/false) In TDLib pending notification updates are stored in ram until you "read" them. This option disables completely notifications and keeps the pending notifications queue empty, reducing memory usage. -* **ignore_update_chat_last_message** (true/false) If you don't care about have updateChatLastMessage updates enable this -* **ignore_update_chat_read_inbox** (true/false) If you don't care about have updateChatReadInbox updates enable this -* **ignore_update_user_chat_action** (true/false) If you don't care about have updateUserChatAction updates enable this -* **ignore_server_deletes_and_reads** (true/false) If you don't care about receiving read receipts and remote deletes from other users, enable this, it will reduce memory usage +* **disable_minithumbnails** (true/**false**) This setting removes minithumbnails everywhere. It reduces memory usage because tdlib keeps them in RAM +* **disable_document_filenames** (true/**false**) If you don't care about having the original filenames of every file stored in RAM, you can disable them using this option. It reduces memory usage +* **disable_notifications** (true/**false**) In TDLib pending notification updates are stored in ram until you "read" them. This option disables completely notifications and keeps the pending notifications queue empty, reducing memory usage +* **ignore_update_chat_last_message** (true/**false**) If you don't care about have updateChatLastMessage updates enable this +* **ignore_update_chat_read_inbox** (true/**false**) If you don't care about have updateChatReadInbox updates enable this +* **ignore_update_user_chat_action** (true/**false**) If you don't care about have updateUserChatAction updates enable this +* **ignore_server_deletes_and_reads** (true/**false**) If you don't care about receiving read receipts and remote deletes from other users, enable this, it will reduce memory usage * **delete_chat_reference_after_seconds** (positive number) During cleanup, free the memory of the chats that have not been touched for more than X seconds * **delete_user_reference_after_seconds** (positive number) During cleanup, free the memory of the users that have not been touched for more than X seconds * **delete_file_reference_after_seconds** (positive number) During cleanup, free the memory of the files that have not been touched for more than X seconds -* **experiment_enable_file_reference_cleanup** (true/false) During cleanup, free the memory of the file references (Experimental!) -* **experiment_debug_file_reference_cleanup** (true/false) During cleanup, print log messages about file references cleanup (Experimental!) -* **experiment_enable_chat_access_hash_cleanup** (true/false) During cleanup, clean chats and channels access hash (Experimental!) +* **experiment_enable_file_reference_cleanup** (**true**/false) During cleanup, free the memory of the file references +* **experiment_enable_chat_access_hash_cleanup** (**true**/false) During cleanup, clean chats and channels access hash ## Custom API functions ### TdApi.OptimizeMemory diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index 50385dda7..0724ffb32 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -14685,7 +14685,7 @@ void ContactsManager::memory_cleanup() { auto user_ttl = !G()->shared_config().get_option_integer("delete_user_reference_after_seconds", 3600); auto chat_ttl = !G()->shared_config().get_option_integer("delete_chat_reference_after_seconds", 3600); - auto chat_access_hash_cleanup = !G()->shared_config().get_option_boolean("experiment_enable_chat_access_hash_cleanup", false); + auto chat_access_hash_cleanup = !G()->shared_config().get_option_boolean("experiment_enable_chat_access_hash_cleanup", true); /* DESTROY INVALID USERS */ { diff --git a/td/telegram/FileReferenceManager.cpp b/td/telegram/FileReferenceManager.cpp index b0d4d0614..431b01edd 100644 --- a/td/telegram/FileReferenceManager.cpp +++ b/td/telegram/FileReferenceManager.cpp @@ -373,7 +373,7 @@ void FileReferenceManager::reload_photo(PhotoSizeSource source, Promise pr } void FileReferenceManager::memory_cleanup() { - if (!G()->shared_config().get_option_boolean("experiment_enable_file_reference_cleanup", false)) { + if (!G()->shared_config().get_option_boolean("experiment_enable_file_reference_cleanup", true)) { return; } auto print_debug_messages = G()->shared_config().get_option_boolean("experiment_debug_file_reference_cleanup", false); diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 2adba6700..0cd2c1679 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -6386,7 +6386,7 @@ void MessagesManager::add_pending_update(tl_object_ptr &&u } auto old_postponed_pts_updates_behavior - = G()->shared_config().get_option_boolean("experiment_old_postponed_pts_updates_behavior", false); + = G()->shared_config().get_option_boolean("experiment_old_postponed_pts_updates_behavior", true); if (td_->updates_manager_->running_get_difference() || (!old_postponed_pts_updates_behavior && !postponed_pts_updates_.empty())) { VLOG(messages) << "Save pending update got while running getDifference from " << source; if (td_->updates_manager_->running_get_difference()) {