View gist:b9c7f9f4d2ebc9d2b621
1 2 3 4 5 6 7 8 9 10
Calculating -------------------------------------
evaluator 1.113k i/100ms
cached 8.832k i/100ms
nokogiri 3.026k i/100ms
-------------------------------------------------
evaluator 11.509k (± 1.5%) i/s - 57.876k
cached 97.749k (± 8.0%) i/s - 485.760k
nokogiri 30.364k (± 9.4%) i/s - 151.300k
 
Comparison:
View gen.rb
1 2 3 4 5 6 7 8 9 10
$:.unshift(File.expand_path('../lib', __FILE__))
 
require 'ast'
require 'oga'
 
class Node
attr_reader :type
 
def initialize(type, children = [])
@type = type.to_sym
View oracle.java
1 2 3 4 5
package com.oracle.is.possibly.the.antichrist;
 
function fuck_oracle(int fuck, int oracle) {
return (fuck < oracle) ? oracle : fuck;
}
View output.txt
1 2 3 4 5 6 7 8 9 10
Calculating -------------------------------------
evaluator 1.097k i/100ms
generated 8.711k i/100ms
-------------------------------------------------
evaluator 10.641k (±13.5%) i/s - 52.656k
generated 99.626k (± 1.1%) i/s - 505.238k
 
Comparison:
generated: 99626.2 i/s
evaluator: 10641.4 i/s - 9.36x slower
View gist:77ade5f3f566eeb6fd17
1 2 3 4 5 6 7 8
require 'slop'
 
puts Slop.parse do |opt|
opt.on '--version', 'Lee has been slacking off' do
puts 'ehm'
exit
end
end
View gist:6f21c0069c3bc89f2f7b
1 2 3 4 5 6 7 8 9 10
require 'oga'
 
document = Oga.parse_html <<-EOF
<div>this should</div>
<span>really go</span>
<b>away</b>
<h1>First Title</h1>
Hello world, how are you <b>doing?</b>
View gist:33943bdd98c7474e4993
1 2 3 4 5 6 7 8 9 10
require 'oga'
 
document = Oga.parse_html <<-EOF
Hello world, how are you <b>doing?</b>
EOF
 
document.xpath('descendant-or-self::b').each do |b_node|
text = Oga::XML::Text.new(:text => "**#{b_node.inner_text}**")
 
b_node.before(text)
View openwat.rb
1 2 3 4 5 6 7 8 9
require 'benchmark/ips'
require 'ostruct'
 
struct = Struct.new(:name)
 
Benchmark.ips do |bench|
bench.report 'Struct' do
struct.new(:name => 'Alice')
end
View gist:963ed5eec85a7afed18c
1 2 3 4 5 6 7 8 9 10
$ cargo run
Compiling aeon v0.0.1 (file:///home/yorickpeterse/Private/Projects/rust/aeon)
Running `target/debug/aeon`
thread '<main>' panicked at 'RefCell<T> already borrowed', /build/rust/src/rustc-1.0.0/src/libcore/cell.rs:436
thread '<main>' panicked at 'arithmetic operation overflowed', /build/rust/src/rustc-1.0.0/src/liballoc/rc.rs:784
stack backtrace:
1: 0x7f3d7ababa99 - sys::backtrace::write::h85e36588f6ec519ed4r
2: 0x7f3d7abaf0bf - panicking::on_panic::h6e154bbd20295560jrw
3: 0x7f3d7aba82d2 - rt::unwind::begin_unwind_inner::h58d8677c31c147e6t6v
4: 0x7f3d7aba899c - rt::unwind::begin_unwind_fmt::h924efd716b4278c074v
View gist:064fc55f0c333d37a4f5
1 2 3 4 5 6 7 8 9
$ make
mkdir -p target
clang -Wextra -Wall -pedantic -std=c++11 src/register.cpp src/variable_scope.cpp src/heap.cpp src/compiled_code.cpp src/call_frame.cpp src/instruction.cpp src/object.cpp -o target/aeon
/usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.2/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
/tmp/register-9740a5.o: In function `std::vector<aeon::Object*, std::allocator<aeon::Object*> >::_M_range_check(unsigned long) const':
src/register.cpp:(.text._ZNKSt6vectorIPN4aeon6ObjectESaIS2_EE14_M_range_checkEm[_ZNKSt6vectorIPN4aeon6ObjectESaIS2_EE14_M_range_checkEm]+0x5a): undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)'
/tmp/register-9740a5.o: In function `void std::vector<aeon::Object*, std::allocator<aeon::Object*> >::_M_insert_aux<aeon::Object*>(__gnu_cxx::__normal_iterator<aeon::Object**, std::vector<aeon::Object*, std::allocator<aeon::Object*> > >, aeon::Object*&&)':
src/register.cpp:(.text._ZNSt6vectorIPN4aeon6ObjectESaIS2_EE13
Something went wrong with that request. Please try again.