Skip to content

Instantly share code, notes, and snippets.

#https://gist.github.com/709860
require 'benchmark'
# does Benchmark::bmbm have environments/setup like Test::Unit
# want some variables to be set per benchmark case - now have to dup them myself
# is is needed as the testcases have destructive operations, otherwise the testcases will be dependent on each other
larger_benchmark = Proc.new do |benchmark|
big = (1..95).to_a
#https://gist.github.com/709860
require 'benchmark'
# does Benchmark::bmbm have environments/setup like Test::Unit
# want some variables to be set per benchmark case - now have to dup them myself
# is is needed as the testcases have destructive operations, otherwise the testcases will be dependent on each other
def benchmark_setup(obj=TOP_SELF)
code = <<-CODE
@Asher-
Asher- / query.rb
Created November 2, 2010 05:03 — forked from banister/query.rb
# How does work?
# at top-level:
Hello #=> :hello
class Friend
puts Hello
end
#=> NameError: uninitialized constant Friend::Hello
@Asher-
Asher- / colors.java
Created October 17, 2010 18:06 — forked from anonymous/colors.java
Colors by Joe
/*
class: Color
type: enum
description: Encapsulates an abstract color. Contains a large list
of different colors which can be accessed like:
Color.Russet
@Asher-
Asher- / prepend.c
Created October 10, 2010 07:11 — forked from banister/prepend.c
/* (c) 2010 John Mair (banisterfiend), Asher (Asher), MIT license */
#include "compat.h"
#include "ruby.h"
VALUE
rb_prepend_methods(VALUE klass)
{
VALUE m = rb_module_new();
st_free_table(RCLASS_M_TBL(m));