Currently, starting a Perl 6 programs means loading a shell script that starts a MoarVM, that loads the rakudo compiler (as bytecode) and libraries (also bytecode), before loading the user script and compiling that. This adds significantly to the startup time of perl6
This file has been truncated, but you can view the full file.
This file contains hidden or 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
Specialization of '' (cuid: 1) | |
Before: | |
Spesh of '' (cuid: 1, file: ./t/spec/S32-str/sprintf-b.t:188) | |
BB 0 (0x7fe9ddcb3818): | |
line: 188 (pc 0) | |
Instructions: | |
no_op | |
Successors: 1 |
This file contains hidden or 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 perl | |
package ListUtil; | |
# Reimplementation of List::Util for running on perl 5.10 | |
use strict; | |
use warnings; | |
use Exporter 'import'; | |
@ListUtil::EXPORT_OK = qw(pairgrep pairmap pairkeys pairvalues); | |
sub pairgrep(&@) { | |
my $code = shift; |
This file contains hidden or 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 nqp | |
if (0.125 < 0.126) { | |
nqp::say("OK"); | |
} else { | |
nqp::die("NOT OK"); | |
} |
This file contains hidden or 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
From b0cf91cf7bc32fc20f73f4abc463d952c86983a3 Mon Sep 17 00:00:00 2001 | |
From: Bart Wiegmans <[email protected]> | |
Date: Fri, 17 May 2019 12:45:13 +0200 | |
Subject: [PATCH] [Vector] Implement MVM_VECTOR_CONTAINS with memmem | |
This should be more flexible (arbitrary sized items) and hopefully | |
faster because memmem is fairly optimized. And allows the use as an | |
expression. | |
--- | |
build/Makefile.in | 1 + |
This file contains hidden or 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 nqp | |
sub foo(int64 $x) { | |
my int16 $y := $x; | |
my int64 $z := $y; | |
return $z; | |
} | |
my int $i := 0; | |
while ($i++ < 100_000) { |
This file contains hidden or 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 nqp | |
sub shifter(int $x, int $y) { | |
nqp::abs_i(nqp::bitshiftl_i($x, $y)); | |
} | |
my int $i := 0; | |
while ($i++ < 1_000_000) { | |
my $x := shifter(10,3); | |
if (shifter(10,3) != 80) { |
This file contains hidden or 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
Specialization of 'repository-version' (cuid: 15072) | |
Before: | |
Spesh of 'repository-version' (cuid: 15072, file: SETTING::src/core/CompUnit/Repository/Installation.pm6:129) | |
BB 0 (0x7fffec65a388): | |
line: 129 (pc 0) | |
Instructions: | |
no_op | |
Successors: 1 |
This file contains hidden or 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
#include <stdio.h> | |
/* this takes, excluding compilation, 0.23s on my machine. | |
* MoarVM is within a factor of three of that */ | |
int main(int argc, char **argv) { | |
double x = 0; | |
int i; | |
for (i = 1; i < 50000000; i++) | |
x += 1.0/i; | |
printf("%f", x); |
This file contains hidden or 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
================================================================= | |
==31674==ERROR: LeakSanitizer: detected memory leaks | |
Direct leak of 416 byte(s) in 2 object(s) allocated from: | |
#0 0x7fd9b5224e50 in calloc (/lib64/libasan.so.5+0xeee50) | |
#1 0x7fd9b40924c5 in MVM_calloc src/core/alloc.h:11 | |
#2 0x7fd9b409de50 in MVM_spesh_graph_create src/spesh/graph.c:1214 | |
#3 0x7fd9b40df1f9 in MVM_spesh_inline_try_get_graph_from_unspecialized src/spesh/inline.c:236 | |
#4 0x7fd9b40cd1f3 in optimize_call src/spesh/optimize.c:1831 |
NewerOlder