-
-
Save timo/a493f5fbb80e0f298f92 to your computer and use it in GitHub Desktop.
this blows up to 1.8gb in size after the sleep, while it is at about 0.6 before.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl6 | |
use v6; | |
# This script isn't in bin/ because it's not meant to be installed. | |
BEGIN say 'Initializing ...'; | |
sub recursive-dir($dir) { | |
my @todo = $dir; | |
gather while @todo { | |
my $d = @todo.shift; | |
for dir($d) -> $f { | |
if $f.f { | |
take $f; | |
} | |
else { | |
@todo.push($f.path); | |
} | |
} | |
} | |
} | |
sub MAIN() { | |
say 'Reading lib/ ...'; | |
sleep(10); # sleep to u | |
my @source = recursive-dir('lib').grep(*.f).grep(rx{\.pod$}); | |
@source .= map: {; .path.subst('lib/', '').subst(rx{\.pod$}, '').subst(:g, '/', '::') => $_ }; | |
say @source.elems; | |
sleep(10); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment