lib/picky/indexes.rb in picky-4.27.1 vs lib/picky/indexes.rb in picky-4.28.1
- old
+ new
@@ -41,9 +41,21 @@
#
def clear_indexes
@indexes = []
@index_mapping = Hash.new
end
+
+ # Tries to optimize the memory usage of the indexes.
+ #
+ def optimize_memory array_references = Hash.new
+ dedup = Picky::Optimizers::Memory::ArrayDeduplicator.new
+ @indexes.each do |index|
+ index.optimize_memory array_references
+ end
+ end
+ def self.optimize_memory array_references = Hash.new
+ self.instance.optimize_memory array_references
+ end
# Registers an index with the indexes.
#
def register index
# TODO Do not store duplicate indexes.
\ No newline at end of file