Perl weak references are implemented as a singly-linked list. Destroying a weak reference is thus O(n) if you have n weak references to a particular variable. So destroying N weak references to the same variable is O(N**2).
Having 200k weak references to the same variable is not a normal use-case. I'm not surprised that it is slow.
- tye
In reply to Re: Slow GC after Scalar::Util::weaken (O)
by tye
in thread Slow GC after Scalar::Util::weaken
by jura05
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |