From 7d4c489816e8746032be3f94b08e804a758dcb08 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Sat, 17 Sep 2022 17:23:46 +0200 Subject: [PATCH] Disable timeline cleanup mechanisms that are no longer necessary Element's new timeline alg should keep is free from timeline loops and empty chunks. Thus, removing these checks should give us back a little bit of faster room loading. Change-Id: I7c6bc314b98410dd47af44e958422860f26771ce --- .../session/room/timeline/LoadTimelineStrategy.kt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/LoadTimelineStrategy.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/LoadTimelineStrategy.kt index 171c5d8e6b..e6b3058268 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/LoadTimelineStrategy.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/LoadTimelineStrategy.kt @@ -60,14 +60,10 @@ import java.util.concurrent.atomic.AtomicReference * Once we got a ChunkEntity we wrap it with TimelineChunk class so we dispatch any methods for loading data. */ -// Whether to search for timeline loops, and fix them. -// TODO: once we feel comfortable that this is no longer necessary, -// we probably want to disable this again for improving performance. -const val ENABLE_TIMELINE_LOOP_SPLITTING = true -// Whether to search for stuck timelines due to empty self-linking chunks. -// TODO: once we feel comfortable that this is no longer necessary, -// we probably want to disable this again for improving performance. -const val ENABLE_TIMELINE_EMPTY_CHUNK_CLEANUP = true +// [No longer necessary] Whether to search for timeline loops, and fix them. +const val ENABLE_TIMELINE_LOOP_SPLITTING = false +// [No longer necessary] Whether to search for stuck timelines due to empty self-linking chunks. +const val ENABLE_TIMELINE_EMPTY_CHUNK_CLEANUP = false // Performance consideration for huge timelines, when having ENABLE_TIMELINE_LOOP_SPLITTING or ENABLE_TIMELINE_EMPTY_CHUNK_CLEANUP set to true const val MAX_CHUNK_REPAIR_CHECK_COUNT = 100