Skip to content

Instantly share code, notes, and snippets.

Elizabeth Mattijsen lizmat

Block or report user

Report or block lizmat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:83476091b86901b90fb0a005bab53986
$ 6l 'use Inline::Perl5'
Cannot unbox a type object (int64) to int.
at gen/moar/stage2/QASTNode.nqp:387 (/Users/liz/Github/rakudo.moar/install/share/nqp/lib/QASTNode.moarvm:new)
from src/Perl6/World.nqp:3053 (/Users/liz/Github/rakudo.moar/install/share/perl6/lib/Perl6/World.moarvm:add_constant_folded_result)
from gen/moar/Perl6-Actions.nqp:5163 (/Users/liz/Github/rakudo.moar/install/share/perl6/lib/Perl6/Actions.moarvm:type_declarator:sym<constant>)
from gen/moar/stage2/QRegex.nqp:1545 (/Users/liz/Github/rakudo.moar/install/share/nqp/lib/QRegex.moarvm:!cursor_pass)
from gen/moar/Perl6-Grammar.nqp:2937 (/Users/liz/Github/rakudo.moar/install/share/perl6/lib/Perl6/Grammar.moarvm:type_declarator:sym<constant>)
from gen/moar/stage2/QRegex.nqp:1644 (/Users/liz/Github/rakudo.moar/install/share/nqp/lib/QRegex.moarvm:!protoregex)
from <unknown>:1 (/Users/liz/Github/rakudo.moar/install/share/perl6/lib/Perl6/Grammar.moarvm:type_declarator)
from gen/moar/Perl6-Grammar.nqp:2187 (/Users/liz/Github/rakudo.
@lizmat
lizmat / gist:2ed4732f8acff8bba03aa371a130b78c
Created Jun 9, 2019
2 profiles of the same code, one before MoarVM bump, one after
View gist:2ed4732f8acff8bba03aa371a130b78c
<!DOCTYPE html>
<html lang="en" ng-app="moarProfApp" ng-controller="NavigationController">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>MoarVM Profiler Results</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css">
<style>
View gist:0102c94fb8c7ddff333cbec854a0465f
$ 6 'use Data::Dump::Tree; use nqp; ddt nqp::backendconfig'
{153} @0
├ ar => ar.Str
├ arflags => rcs.Str
├ arout => .Str
├ as => as.Str
├ asm => .s.Str
├ asmout => -o .Str
├ asmswitch => -S.Str
├ auxclean => @:.Str
View gist:99c0246aff5ee0abf0579e8905e91106
$ 6mp 'sub a() { my $a = 42 }; .say for profile( { a for ^10000 } ).my_callees'
Unnamed callee was called 1 time
at -e line 1
from thread #1.
Was jitted and had an On-Stack-Replacement.
Called at 0 microsecs and ran for 5649 microsecs.
Did 12455 allocations (of which 1 (0.01%) was done here).
Unnamed callee was called 10000 times
at -e line 1
View gist:7927b91197cfb4435c4129ef664ef49e
Type 'Rakudo::Iterator::IntRange' of REPR 'P6opaque' (56 bytes)
Type 'PseudoStash' of REPR 'P6opaque' (56 bytes)
Type 'MoarVM::StringHeap' of REPR 'P6opaque' (56 bytes)
Type 'QAST::SVal' of REPR 'P6opaque' (72 bytes)
Type 'VMString' of REPR 'MVMString' (48 bytes)
Type 'ContainerDescriptor::Untyped' of REPR 'P6opaque' (64 bytes)
Type 'MAST::Lexical' of REPR 'P6opaque' (48 bytes)
Type 'MoarVM::BytecodeWriter' of REPR 'P6opaque' (104 bytes)
Type 'Array::ArrayReificationTarget' of REPR 'P6opaque' (48 bytes)
Type 'Rakudo::Iterator::ReifiedArrayIterator' of REPR 'P6opaque' (56 bytes)
View gist:cecd280112920719f87cb5c9a8fe0ee7
use nqp;
# Process a given set of feed operations from a given source and a list of
# Callables to execute. Returns a Seq to be used to storing in the pointy
# end of the feeds.
sub PROCESS-FEED($source, @stages --> Seq:D) {
my class Pipeline is repr('ConcBlockingQueue') {}
# Process a stage with given code for given iterator
my class Process does Iterator {
@lizmat
lizmat / gist:787a6ddb31d51cc67d0c00f3403de78c
Last active May 21, 2019
fast as you can parallel feed
View gist:787a6ddb31d51cc67d0c00f3403de78c
use nqp;
# Process a given set of feed operations from a given source and a list of
# Callables to execute. Returns a Seq to be used to storing in the pointy
# end of the feeds.
sub PROCESS-FEED($source, @stages --> Seq:D) {
my class Pipeline is repr('ConcBlockingQueue') {}
# Process a stage with given code for given iterator
my class Process does Iterator {
View gist:8652e4a403fffe64e84b392b31cc6ad4
use nqp;
sub PROCESS-FEED($source, @stages --> Seq:D) {
my class Pipeline is repr('ConcBlockingQueue') {}
# process a stage with given code for given iterator
my class Process does Iterator {
has &.code;
has $.iterator;
View gist:69faa8cb0f2d4972f17561b21bace743
use nqp;
sub PROCESS-FEED($source, @stages --> Seq:D) {
# process a stage with given code for given iterator
my class Process does Iterator {
has &.code;
has $.iterator;
has $.is-lazy;
View gist:abf5a897d1e4f629089245be7f8b3666
my $then;
my %h = ^1000;
for ^5 {
$then = now;
for ^5000 { my $a := %h.max(*.value) }
say now - $then;
}
You can’t perform that action at this time.