Skip to content

Instantly share code, notes, and snippets.

View macournoyer's full-sized avatar

Marc-André Cournoyer macournoyer

View GitHub Profile
======================environment======================
yarv
command: ruby19
version: ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-darwin9.6.0]
jruby
command: PATH=$JDKS_ROOT/1.6.0/Home/bin:$PATH ~/projects/jruby/bin/jruby -server --fast
version: jruby 1.3.0 (ruby 1.8.6 patchlevel 287) (2009-03-12 rev 9393) [x86_64-java]
mri
command: ruby
version: ruby 1.8.6 (2007-09-24 patchlevel 111) [i686-darwin9.3.0]
x = 1
while x < 50000000
x = x + 1
end
; block definition: 0xaaf80 (level 0)
; 2 registers ; 0 nested blocks
; 0 args
.local x ; 0
.value 1 ; 0
generator = Compiler::TextGenerator.new
node = Compiler.compile_string "1", binding
node.bytecode generator
puts generator.text
is_indexed :fields => %w(title description created_at updated_at),
:include => [{:association_name => 'location', :field => 'locality', :as => 'locality'},
{:association_name => 'location', :field => 'region', :as => 'region'},
{:association_name => 'location', :field => 'country', :as => 'country'}],
:concatenate => [{:fields => %w(locality region country), :as => "location"}],
:delta => true
@macournoyer
macournoyer / gist:80852
Created March 18, 2009 00:14
Lua-like upvalues in tinyrb
def yielder
yield
end
x = "yeaaah!"
yielder do
yielder do
x
end
require ::File.dirname(__FILE__) + '/../lib/thin'
app = proc do |env|
if env["PATH_INFO"].match(/\.js/)
[
200,
{ 'Content-Type' => 'text/javascript' },
["var a = 'muffin';"]
]
tinyrb$ ~/projects/rubinius/bin/rbx bench/bm_vm1_const.rb
An exception has occurred:
is not a class/module (TypeError)
Backtrace:
Kernel(NilClass)#__const_set__ at kernel/common/kernel.rb:378
main.__script__ at bench/bm_vm1_const.rb+5
CompiledMethod#activate_as_script at kernel/common/compiled_method.rb:146
CompiledMethod#as_script at kernel/common/compiled_method.rb:139
Compiler::Utils.single_load at kernel/compiler/compile.rb:236
(in /Users/marc/projects/rubinius)
CC vm/test/runner.cpp
In file included from vm/test/runner.cpp:21:
./vm/test/test_access_variable.hpp:5:28: error: builtin/task.hpp: No such file or directory
In file included from vm/test/runner.cpp:878:
./vm/test/test_contexts.hpp:4:32: error: builtin/contexts.hpp: No such file or directory
In file included from vm/test/runner.cpp:3742:
./vm/test/test_objectmemory.hpp:3:21: error: vm/gc.hpp: No such file or directory
./vm/test/test_objectmemory.hpp:4:26: error: vm/gc_root.hpp: No such file or directory
In file included from vm/test/runner.cpp:4535:
@macournoyer
macournoyer / gist:78194
Created March 12, 2009 17:52
tinyrb benchmark
======================environment======================
yarv
command: ruby19
version: ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-darwin9.6.0]
jruby
command: ~/projects/jruby/bin/jruby -server --fast
version: jruby 1.3.0 (ruby 1.8.6 patchlevel 287) (2009-03-12 rev 9393) [x86_64-java]
mri
command: ruby
version: ruby 1.8.6 (2007-09-24 patchlevel 111) [i686-darwin9.3.0]
jruby$ rake
(in /Users/marc/projects/jruby)
Buildfile: build.xml
prepare:
[mkdir] Created dir: /Users/marc/projects/jruby/build/classes
[mkdir] Created dir: /Users/marc/projects/jruby/build/classes/jruby
[mkdir] Created dir: /Users/marc/projects/jruby/build/classes/test
[mkdir] Created dir: /Users/marc/projects/jruby/build/test-results
[mkdir] Created dir: /Users/marc/projects/jruby/build/test-results/html