Skip to content

Instantly share code, notes, and snippets.

BuiltinFunctions::ProhibitBooleanGrep
BuiltinFunctions::ProhibitStringyEval
BuiltinFunctions::ProhibitStringySplit
BuiltinFunctions::ProhibitUniversalCan
BuiltinFunctions::ProhibitUniversalIsa
ClassHierarchies::ProhibitExplicitISA
ControlStructures::ProhibitMutatingListFunctions
ControlStructures::ProhibitUnreachableCode
ErrorHandling::RequireCarping
InputOutput::ProhibitBarewordFileHandles
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active April 26, 2024 23:26 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@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
@headius
headius / results
Created January 10, 2012 20:05
Compare Nokogiri on JRuby (Apache Xerces) with 1.9.3 (libxml2)
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)
@igrigorik
igrigorik / ab.txt
Created November 17, 2011 06:14
jruby + goliath
# 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
@headius
headius / partial_application.rb
Created September 18, 2011 21:52
Partial application that works on all Ruby implementations
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, :_)
anonymous
anonymous / gist:1212690
Created September 12, 2011 22:43
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
@mikhailov
mikhailov / ruby_gc.sh
Created March 11, 2011 10:33
Ruby’s GC Configuration
- 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
@mfdela
mfdela / fiber.rb
Created February 13, 2011 00:44
Ruby fiber benchmark
#!/usr/bin/ruby1.9
require 'fiber'
require 'benchmark'
class Ring
attr_reader :id
attr_accessor :attach
def initialize(id)
@cheeyeo
cheeyeo / rspec_optmization_2.rb
Created January 21, 2011 18:15
Optimizing the garbage collector in Rspec
# delay the GC - usage as below
# Spec::Runner.configure do |config|
.....
# config.before(:each) do
# begin_gc_deferment
# end
# config.after(:each) do