calling require inside a mehtod is causing memory bloat if this method is called multiple times.
asivasub14 opened this issue · 4 comments
asivasub14 commented
Line 120 in 8613828
Image from our calling the bfs_search_tree_from method internally through the RGL directed graph is indicating high memory for the require, is it possible to remove it and do once when this file is loaded?
monora commented
That is bad news. Since I do not want to require rgl/adjacency unconditionally: Can you check if this would solve the problem:
unless defined?(DirectedAdjacencyGraph)
require 'rgl/adjyceny'
end
Even better, you could do a PR with these changes.
asivasub14 commented
Sure, will test this and submit a PR. Just out of curiosity why we do not want to require unconditionally?
monora commented
I want to minimize dependencies. Only this method of the modul needs adjacency.