Use THashSet for sets that are assumed to be big

Otherwise, a lot of memory is wasted on nodes instances

(cherry picked from commit 4922f87)
This commit is contained in:
Denis Zharkov
2018-07-18 13:05:11 +03:00
parent 2fd9b3ee35
commit 8050869e45
5 changed files with 9 additions and 5 deletions
@@ -17,6 +17,7 @@
package org.jetbrains.kotlin.daemon
import com.intellij.util.containers.StringInterner
import gnu.trove.THashSet
import org.jetbrains.kotlin.daemon.common.CompilerCallbackServicesFacade
import org.jetbrains.kotlin.daemon.common.DummyProfiler
import org.jetbrains.kotlin.daemon.common.Profiler
@@ -29,7 +30,7 @@ import org.jetbrains.kotlin.incremental.components.ScopeKind
class RemoteLookupTrackerClient(val facade: CompilerCallbackServicesFacade, eventManager: EventManager, val profiler: Profiler = DummyProfiler()) : LookupTracker {
private val isDoNothing = profiler.withMeasure(this) { facade.lookupTracker_isDoNothing() }
private val lookups = hashSetOf<LookupInfo>()
private val lookups = THashSet<LookupInfo>()
private val interner = StringInterner()
override val requiresPosition: Boolean = profiler.withMeasure(this) { facade.lookupTracker_requiresPosition() }