This file contains 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
BuiltinFunctions::ProhibitBooleanGrep | |
BuiltinFunctions::ProhibitStringyEval | |
BuiltinFunctions::ProhibitStringySplit | |
BuiltinFunctions::ProhibitUniversalCan | |
BuiltinFunctions::ProhibitUniversalIsa | |
ClassHierarchies::ProhibitExplicitISA | |
ControlStructures::ProhibitMutatingListFunctions | |
ControlStructures::ProhibitUnreachableCode | |
ErrorHandling::RequireCarping | |
InputOutput::ProhibitBarewordFileHandles |
This file contains 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
This playbook has been removed as it is now very outdated. |
This file contains 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
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 |
This file contains 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
system ~/projects/nokogiri $ pickjdk 1 | |
New JDK: 1.6.0.jdk | |
system ~/projects/nokogiri $ jruby -v xmlbench.rb | |
jruby 1.7.0.dev (ruby-1.8.7-p357) (2012-01-10 bd4cc62) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java] | |
11.331000 0.000000 11.331000 ( 11.331000) | |
10.239000 0.000000 10.239000 ( 10.239000) | |
10.185000 0.000000 10.185000 ( 10.185000) | |
10.113000 0.000000 10.113000 ( 10.113000) | |
10.120000 0.000000 10.120000 ( 10.120000) |
This file contains 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
# after warming up the VM (20k reqs+) | |
# ... | |
ab -c 50 -n 5000 http://127.0.0.1:9000/ | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking 127.0.0.1 (be patient) | |
Completed 500 requests |
This file contains 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
class Object | |
def _(name, *partial_args) | |
Proc.new do |*new_args| | |
send name, *partial_args.map {|arg| arg == :_ ? new_args.shift : arg} | |
end | |
end | |
end | |
# Practical examples: | |
[1,2,3].each &_(:puts, :_) |
This file contains 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
irb(main):009:0> require 'java' | |
=> false | |
irb(main):010:0> mf = Java::sun.management.ManagementFactory | |
=> Java::SunManagement::ManagementFactory | |
irb(main):011:0> hs_mem = mf.hotspot_memory_mbean | |
=> #<#<Class:0x3cbdb6ae>:0x7987b5ff> | |
irb(main):012:0> ctrs = hs_mem.internal_memory_counters | |
=> #<Java::JavaUtil::ArrayList:0x2e41dc79> | |
irb(main):013:0> ctrs.each {|x| puts "#{x.name} = #{x.value} #{x.units}"} | |
sun.gc.cause = No GC String |
This file contains 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
- http://www.coffeepowered.net/2009/06/13/fine-tuning-your-garbage-collector/ | |
- http://snaprails.tumblr.com/post/241746095/rubys-gc-configuration | |
article’s settings: ("spec spec" took 17-23!sec) | |
export RUBY_HEAP_MIN_SLOTS=1250000 | |
export RUBY_HEAP_SLOTS_INCREMENT=100000 | |
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 | |
export RUBY_GC_MALLOC_LIMIT=30000000 | |
export RUBY_HEAP_FREE_MIN=12500 |
This file contains 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/ruby1.9 | |
require 'fiber' | |
require 'benchmark' | |
class Ring | |
attr_reader :id | |
attr_accessor :attach | |
def initialize(id) |
This file contains 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
# delay the GC - usage as below | |
# Spec::Runner.configure do |config| | |
..... | |
# config.before(:each) do | |
# begin_gc_deferment | |
# end | |
# config.after(:each) do |
NewerOlder