in reply to Slow GC after Scalar::Util::weaken
You'd have to change#!/usr/bin/perl -w use strict; use Scalar::Util qw(weaken); my @data = (1, 2, 3); weaken( my $indirection = \@data ); print time, " test 0: main start\n"; &gogogo(); print time, " test 3: main end\n"; sub gogogo { print time, " test 1: func start\n"; my @h; for (1 .. 200000) { my %hash = (data => $indirection); push @h, \%hash; } print time, " test 2: func end\n"; }
tomy $data = $h[0]{data};
if you use this workaround.my $data = ${ $h[0]{data} };
|
|---|