Improvement of memory management for #678 by victor-cr · Pull Request #699 · debug-js/debug
Thanks for this PR! I was thinking of submitting a similar one myself, as we just discovered that this memory leak was hitting us hard.
I was thinking about using a Map instead of an object for the instances. Would that be a better choice?
Map seems like the more suitable data structure for this usage and would simplify the code in destroy and enable, but I'm not sure of the relative performance characteristics, or whether Map is available in every target environment.