Skip to content

Instantly share code, notes, and snippets.

View rurban's full-sized avatar
💭
Broke my right shoulder, cannot type much

Reini Urban rurban

💭
Broke my right shoulder, cannot type much
View GitHub Profile
@rurban
rurban / 0001-optimize-return-in-pmc-methods.patch
Created June 27, 2014 14:19
pcc: optimize return in pmc methods
From af38a34ef19b7ebc912d4d8e688feadb2a82e983 Mon Sep 17 00:00:00 2001
From: Reini Urban <[email protected]>
Date: Thu, 19 Jun 2014 08:40:29 -0600
Subject: [PATCH 1/2] optimize return in pmc methods
---
lib/Parrot/Pmc2c/PCCMETHOD.pm | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git lib/Parrot/Pmc2c/PCCMETHOD.pm lib/Parrot/Pmc2c/PCCMETHOD.pm
static void
Parrot_Float_nci_acos(PARROT_INTERP, ARGMOD(PMC *_self))
{
PMC * const _ctx = CURRENT_CONTEXT(interp);
PMC * const _call_object = Parrot_pcc_get_signature(interp, _ctx);
{ /* BEGIN PARMS SCOPE */
/* Parrot_pcc_fill_params_from_c_args(interp, _call_object, "Pi",
&_self); */
diff --git src/pmc/integer.pmc src/pmc/integer.pmc
index e43e90b..3ca3679 100644
--- src/pmc/integer.pmc
+++ src/pmc/integer.pmc
@@ -417,17 +417,16 @@ Adds C<value> to C<SELF> inplace.
MULTI void i_add(Complex value) {
const INTVAL a = SELF.get_integer();
- UNUSED(a);
-
@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"
);
@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 / 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 / log.asan-ubsan
Last active July 25, 2022 07:37
Testing openssl with -DOPENSSL_NO_BUF_FREELISTS and -fsanitize=undefined
Note that OpenBSD also disabled the openssl freelist "optimization".
CFLAGS+= -DOPENSSL_NO_BUF_FREELISTS -DOPENSSL_NO_HEARTBEAT
http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libssl/ssl/Makefile?rev=1.29;content-type=text%2Fx-cvsweb-markup
I used:
CC= clang
CFLAG+= -O3 -fsanitize=address -fsanitize=undefined -DOPENSSL_NO_BUF_FREELISTS -g
I also created a more readable version at https://github.com/rurban/openssl
@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 / 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 / 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