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 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 |
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
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); */ |
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
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); | |
- |
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
# -*- 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" | |
); |
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
#!/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 |
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
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 |
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
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 |
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
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. |
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
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 \ |
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
# 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 |