Skip to content

Instantly share code, notes, and snippets.

@AlexDaniel
Created February 8, 2018 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexDaniel/c86673983fe6c1f7eb8451cd91a8f335 to your computer and use it in GitHub Desktop.
Save AlexDaniel/c86673983fe6c1f7eb8451cd91a8f335 to your computer and use it in GitHub Desktop.
use HTTP::UserAgent;
use Telemetry;
sub foo($build) {
my $ua = HTTP::UserAgent.new;
$ua.timeout = 10;
my $response = $ua.get: “https://whateverable.6lang.org/$build”, :bin;
if $response.is-success {
my $claimed = $response.header.field(‘Content-Disposition’).values[0];
my $filename = ($claimed ~~ /‘filename=’\s*(<.xdigit>+[‘.zst’|‘.lrz’])/)[0];
say $filename;
spurt $filename, $response.content, :bin;
} else {
die $response.status-line;
}
}
say T<max-rss>.fmt(‘%.2f’) ÷ 1024 ~ ‘MiB maxrss – before doing anything!!’;
for <2016.09 2016.10 2016.11 2016.12 2017.01 2017.02 2017.03> {
foo $_;
say T<max-rss>.fmt(‘%.2f’) ÷ 1024 ~ ‘MiB maxrss ’;
use nqp; nqp::force_gc();
say T<max-rss>.fmt(‘%.2f’) ÷ 1024 ~ ‘MiB maxrss – after force_gc’;
}
104.113281MiB maxrss – before doing anything!!
「4b32fcab2192054b82312cde4c235adda0b8ac4d.zst」
1734.730469MiB maxrss
1734.730469MiB maxrss – after force_gc
「eb3123e5e60fa1635ed1ee121cec1290c290044a.zst」
1734.730469MiB maxrss
1734.730469MiB maxrss – after force_gc
「f66f8be09c6023b3b53e32f7571ea536ad87b87f.zst」
1765.121094MiB maxrss
1765.121094MiB maxrss – after force_gc
「b2a3441749878e338b0861b14b3b9433cc902f42.zst」
1794.269531MiB maxrss
1794.269531MiB maxrss – after force_gc
「78980ed447cceff82f5efef16dbe9ee437aae809.zst」
1827.550781MiB maxrss
1827.550781MiB maxrss – after force_gc
「aa94ffc33712c6f3068c6472b79a74fa70aa7b2e.zst」
1857.207031MiB maxrss
1857.207031MiB maxrss – after force_gc
「a0a28432f54d608130f17247f9202f4c4939dfff.zst」
1859.015625MiB maxrss
1859.015625MiB maxrss – after force_gc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment