From 40dcdc51e82fada425f4aa8e2a8abebbfc9de58d Mon Sep 17 00:00:00 2001 From: Alexandr Evstigneev Date: Thu, 2 Feb 2023 19:21:54 +0400 Subject: [PATCH] IDEA-311645 Replaced ArrayDeque with LinkedLIst Despite ArrayDeque claims to work faster than LinkedList, it consumes memory even when it's empty. Especially when we have a lot of Nodes expanded. This change should not noticeably reduce performance, but should reduce a memory footprint. GitOrigin-RevId: 252eb18dc96466eaa9fb34bb7f655f1a42a449cd --- .../platform-impl/src/com/intellij/ui/tree/AsyncTreeModel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/ui/tree/AsyncTreeModel.java b/platform/platform-impl/src/com/intellij/ui/tree/AsyncTreeModel.java index 426dec119b5b..1c48b6b1ea54 100644 --- a/platform/platform-impl/src/com/intellij/ui/tree/AsyncTreeModel.java +++ b/platform/platform-impl/src/com/intellij/ui/tree/AsyncTreeModel.java @@ -693,7 +693,7 @@ public final class AsyncTreeModel extends AbstractTreeModel implements Searchabl } private static final class CommandQueue { - private final Deque deque = new ArrayDeque<>(); + private final LinkedList deque = new LinkedList<>(); private volatile boolean closed; T get() {