Skip to content

Instantly share code, notes, and snippets.

View rurban's full-sized avatar

Reini Urban rurban

View GitHub Profile
@rurban
rurban / gist:9191540
Created February 24, 2014 16:25
fixup perl5 smueller/fewer_listops3
commit eee398c1fd66c1434f722ea288ec779be2380722
Author: Reini Urban <rurban@x-ray.at>
Date: Mon Feb 24 10:24:56 2014 -0600
fixup: op.c:11163:5: -Wdeclaration-after-statement
op.c: In function ‘S_null_listop_in_list_context’:
op.c:11163:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
OP *kid = cLISTOPo->op_first;
cil:
$ git checkout develop && git pull && ./configure
Already on 'develop'
Your branch is up-to-date with 'origin/develop'.
Already up-to-date.
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
@rurban
rurban / control.pm
Last active August 29, 2015 13:57
rakudo: parrot openpipe with rurban/openpipe-env-gh1065
sub QX($cmd) {
#if? parrot
my $pipe := pir::new__Ps('FileHandle');
my $env := pir::new__Ps('Env');
$pipe.set_keyed('env', $env);
$pipe.open(nqp::unbox_s($cmd), 'rp');
fail "Unable to execute '$cmd'" unless $pipe;
$pipe.encoding('utf8');
my $result := $pipe.readall;
@rurban
rurban / gist:9605884
Last active August 29, 2015 13:57
rakudo 1aeb7c3
What could this be?
./perl6-p --setting=NULL --optimize=3 --target=pir --stagestats --output=src/gen/p-CORE.setting.pir gen/parrot/CORE.setting
Stage start : 0.000
Error while compiling, type X::Undeclared::Symbols
post_types: Hash<5920886953964591723>
unk_types: Hash<5920886953964600947>
unk_routines: Hash<5920886953964564843>
routine_suggestion: Hash<5920886953964562799>
type_suggestion: Hash<5920886953964569977>
@rurban
rurban / parrot-bench-20140320.data
Created March 20, 2014 16:41
parts of benchmarks examples which run all ok releases
# parrot-bench
# release secs
2.0 8.72
2.1 8.30
2.1.1 8.29
2.2 8.23
2.3 10.38
2.4 8.74
2.5 8.52
2.6 8.59
@rurban
rurban / gist:9668411
Last active August 29, 2015 13:57
parrot-bench
cat ../bench.sh
#!/bin/sh
if [ -n $1 ]; then
git clean -dxf 2>&1 >/dev/null
git checkout $1 2>&1 >/dev/null
else
make -s clean archclean 2>&1 >/dev/null
fi
perl Configure.pl --optimize --without-crypto --without-opengl 2>&1 >/dev/null \
@rurban
rurban / log.valgrind
Last active August 29, 2015 13:58
Testing openssl with -DOPENSSL_NO_BUF_FREELISTS and valgrind
linux-x86_64 shared:
$ ./config
add -DOPENSSL_NO_BUF_FREELISTS to CFLAG in Makefile (because of http://article.gmane.org/gmane.os.openbsd.misc/211963)
$ make
$ export LD_LIBRARY_PATH=`pwd`
$ cd test
find out how to test openssl with valgrind, oops. nope. but make files creates a nice list of EXE targets which contain the tests.
@rurban
rurban / crc.patch
Last active August 29, 2015 13:58
Statistics for perl hash tables
Just trying performance and quality of the Intel HW CRC32
In real code this should be checked in perl_init for CPU features.
I guess the hash function is not quite kosher yet, but gives a
rough estimate for the data I'm looking for: performance and
number of collisions.
diff --git hv_func.h hv_func.h
index 191912a..38134bc 100644
--- hv_func.h
@rurban
rurban / fulltest.sh
Last active August 29, 2015 14:01
/usr/src/parrot/fulltest.sh - make optimized, tune it and run all tests
#!/bin/sh
make-4.0 -j4 -s clean archclean
# clang is the fastest
perl Configure.pl --optimize --cc="clang" --link="clang" --ld="clang" --cxx="clang" \
--maintainer
set -x
sed -i 's/-shared -O2/-shared -Wl,-O1/' Makefile config_lib.pir lib/Parrot/Config/Generated.pm
# highly specific to my system
sed -i 's|-fstack-protector -L/usr/local/lib|-fstack-protector -L/usr/local/lib -Wl,--as-needed -Wl,-z,relro -Wl,-z,now|' Makefile config_lib.pir lib/Parrot/Config/Generated.pm
@rurban
rurban / .perldb
Last active August 29, 2015 14:01
parrot pmc2c debugging
# -*- perl -*- for parrot pmc2c WB debugging
# perl -d -Ilib tools/build/pmc2c.pl --dump src/pmc/fixedintegerarray.pmc
sub afterinit {
push @DB::typeahead, (
"c 51", "s",
#"b postpone Parrot::Pmc2c::PMC::Null::pre_method_gen",
"b Parrot::Pmc2c::Dumper::dump_pmc",
"b Parrot::Pmc2c::Emitter::add_write_barrier",
"b Parrot::Pmc2c::PCCMETHOD::rewrite_RETURNs"
);