Skip to content

Instantly share code, notes, and snippets.

View funny-falcon's full-sized avatar

Sokolov Yura funny-falcon

View GitHub Profile
@funny-falcon
funny-falcon / cache_expanded_load_path.patch
Created December 15, 2011 08:47
Cache expanded_load_patch (patch against ruby-1.9.3-p0)
From 9088356975d13a9a7fbe6832dfd56a8b2ff7b21d Mon Sep 17 00:00:00 2001
From: Sokolov Yura <funny.falcon@gmail.com>
Date: Wed, 18 Jan 2012 14:01:59 +0400
Subject: [PATCH] cached load_path patch
This patch add caching of expanded $LOAD_PATH elements.
It invalidates cache on current directory change and
filesystem encoding change.
---
internal.h | 2 +
@funny-falcon
funny-falcon / cached_lp_sorted_lf.patch
Created December 16, 2011 07:41
Cumulative: Sorted loaded features + Cached load path (against 1.9.3-p0)
diff --git a/file.c b/file.c
index 81f28ff..6aad4b0 100644
--- a/file.c
+++ b/file.c
@@ -2819,6 +2819,20 @@ ntfs_tail(const char *path)
buflen = RSTRING_LEN(result),\
pend = p + buflen)
+#define EXPAND_PATH()\
+ if ( !(abs_mode & FEP_DIR_EXPANDED) ) { \
@funny-falcon
funny-falcon / hash_optimize.patch
Created December 22, 2011 08:10
Hash optimize patch (1.9.3-p0)
diff --git a/common.mk b/common.mk
index ea244cc..4f22609 100644
--- a/common.mk
+++ b/common.mk
@@ -629,7 +629,8 @@ file.$(OBJEXT): {$(VPATH)}file.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
gc.$(OBJEXT): {$(VPATH)}gc.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
{$(VPATH)}regex.h $(ENCODING_H_INCLUDES) $(VM_CORE_H_INCLUDES) \
{$(VPATH)}gc.h {$(VPATH)}io.h {$(VPATH)}eval_intern.h {$(VPATH)}util.h \
- {$(VPATH)}debug.h {$(VPATH)}internal.h {$(VPATH)}constant.h
+ {$(VPATH)}debug.h {$(VPATH)}internal.h {$(VPATH)}constant.h \
@funny-falcon
funny-falcon / bench.txt
Created December 27, 2011 08:58
Testing Redmine with hash patch
Test of Redmine issues/issue pages with ruby patched by `compact hash` patch.
I choose this pages cause Issue model have 23 fields and User model hash 17 fields.
Benchmark env:
Ubuntu 11.04 32bit, rvm, AthlonX2 @2000GHz
export RUBY_GC_MALLOC_LIMIT=60000000
export RUBY_HEAP_MIN_SLOTS=1000000
export RUBY_FREE_MIN=500000
export RAILS_ENV=production
@funny-falcon
funny-falcon / test_malloc.c
Created January 11, 2012 07:16
Test malloc allocation steps

Test of malloc allocation strategy.

Environment: Ubuntu 11.04 32bit. libc - libc6 (2.13ubuntu) tcmalloc - libtcmalloc_minimal0 1.5-1 jemalloc - jemalloc 2.2.5 standalone

tested allocation of 1000000 chunks with time -f %M chunk sizes are from 1 to 600. Only allocation strategy boundaries are shown.

@funny-falcon
funny-falcon / a_test.sh
Created January 17, 2012 13:22
Performance tesing of patches for st_table (Ruby-trunk)
RTRUNK=/home/yura/tmp/ruby/bin
alias mtime='/usr/bin/time -f "real %e\tuser %U\tsys %S\nmax %M\tcw %c" $@'
# WHEN INSTALLED TRUNK
for i in `seq 1 13` ; do echo $i 1>&2 && mtime $RTRUNK/ruby check.rb $i 100000 ; done > st_trunk.log
# 1
# real 0.48 user 0.47 sys 0.00
# max 19760 cw 4
# 2
# real 0.60 user 0.58 sys 0.01
# max 21264 cw 12
@funny-falcon
funny-falcon / backport_gc.patch
Created January 26, 2012 22:43
Backport new GC for ruby-1.9.3-p0
diff --git a/ChangeLog b/ChangeLog
index c4ea779..0a6bf73 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,188 @@
+Tue Jan 17 12:32:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (aligned_malloc, aligned_free): covered missing defined
+ operators and fixes for cygwin.
+
@funny-falcon
funny-falcon / performance_and_backport_gc.patch
Created January 27, 2012 05:58
Union of backport GC and performance patches for ruby-1.9.3-p0
diff --git a/ChangeLog b/ChangeLog
index c4ea779..0a6bf73 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,188 @@
+Tue Jan 17 12:32:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (aligned_malloc, aligned_free): covered missing defined
+ operators and fixes for cygwin.
+
@funny-falcon
funny-falcon / 01_testapp_prepare.sh
Created January 30, 2012 03:28
Testing application for GC
git clone git://github.com/RailsApps/rails3-devise-rspec-cucumber.git rails3app
cd rails3app
#lets increase working set
sed -i 's/, :group.*//' Gemfile
sed -i '/^\(group\|end\)/ d' Gemfile
rm Gemfile.lock
bundle install
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rails runner '(1..20).each{|i| User.create(email: "as#{i}@df.gh", name: "asdf#{i}", password: "asdfghjk")}'
bundle exec rake assets:precompile
@funny-falcon
funny-falcon / 00 environment
Created February 2, 2012 19:13
Error on rake with rvm and default gemset
$ uname -a
Linux yura-desktop 2.6.38-13-generic #54-Ubuntu SMP Tue Jan 3 13:44:52 UTC 2012 i686 athlon i386 GNU/Linux
$ rvm -v
rvm 1.10.2 by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.beginrescueend.com/]
$ bash --version
GNU bash, версия 4.2.8(1)-release (i686-pc-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>