From 42062d7ae0299e7d71b54cd5ee37ec1be6a4b03a Mon Sep 17 00:00:00 2001 From: Qijia Liu Date: Sun, 13 Aug 2023 20:13:21 -0400 Subject: [PATCH] perf: release memory of temporary fields (#690) --- src/rime/dict/entry_collector.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rime/dict/entry_collector.cc b/src/rime/dict/entry_collector.cc index cdb7625c5e..7381331323 100644 --- a/src/rime/dict/entry_collector.cc +++ b/src/rime/dict/entry_collector.cc @@ -147,6 +147,9 @@ void EntryCollector::Finish() { } } } + decltype(collection)().swap(collection); + decltype(words)().swap(words); + decltype(total_weight)().swap(total_weight); LOG(INFO) << "Pass 3: total " << num_entries << " entries collected."; }