Skip to content
View gist:8aab8e66be00f64e2b62
git clone git@github.com:YorickPeterse/oga.git
cd oga
bundle install
rake generate fixtures
ruby benchmark/xpath/evaluator/concurrent_time_bench.rb
View stairs.rb
def on_call_lang(input, arg, &block)
lang_var = unique_literal('lang')
node = unique_literal('node')
found = unique_literal('found')
xml_lang = unique_literal('xml_lang')
matched = unique_literal('matched')
conversion = literal(Conversion)
ast = lang_var.assign(try_match_first_node(arg, input))
View pick_ruby.dot
digraph pick_ruby {
rankdir = "TB";
size = "8.5";
esep = 1;
splines = true;
graph [fontname = "Open Sans" fontsize=18];
edge [fontname = "Open Sans" fontsize=18];
node [shape = "rect" fontname = "Open Sans" fontsize=18];
"Do you want concurrency and/or parallelism?" -> "Are you a sadist?" [label = "No"];
View compiler.rb
def on_call_id(input, arg)
orig_input = original_input_literal
node = node_literal
ids_var = unique_literal('ids')
matched = unique_literal('id_matched')
id_str_var = unique_literal('id_string')
attr_var = unique_literal('attr')
matched_assign = matched.assign(literal(XML::NodeSet).new)
View gist:a0e5dd6e58747d8e1b84
Jul 31 14:36:47 [11334] <Warn> Object::copy_object: invalid ivars_ reference for da0381d640a7fea68cab4c88c6d0cbb8
Jul 31 14:36:47 [11334] <Warn> Object::copy_object: invalid ivars_ reference for da0381d640a7fea68cab4c88c6d0cbb8
Jul 31 14:36:47 [11334] <Warn> Object::copy_object: invalid ivars_ reference for {"id":7706,"reviewer_origin":"ceec4312394b8b53fa0de01bae6d7f0f","travel_type":null,"travel_composition":null}
Jul 31 14:36:47 [11334] <Warn> Object::copy_object: invalid ivars_ reference for {"id":7706,"reviewer_origin":"ceec4312394b8b53fa0de01bae6d7f0f","travel_type":null,"travel_composition":null}
Jul 31 14:36:47 [11334] <Warn> Object::copy_object: invalid ivars_ reference for {"id":7706,"reviewer_origin":"ceec4312394b8b53fa0de01bae6d7f0f","travel_type":null,"travel_composition":null}
Jul 31 14:36:47 [11334] <Warn> Object::copy_object: invalid ivars_ reference for {"id":7706,"reviewer_origin":"ceec4312394b8b53fa0de01bae6d7f0f","travel_type":null,"travel_composition":null}
Jul 31 14:36:47 [11334] <Warn> O
View bench.rb
$:.unshift(File.expand_path('../lib', __FILE__))
require 'oga'
require 'benchmark/ips'
require 'nokogiri'
query = 'foo/bar/baz > 20'
ast = Oga::XPath::Parser.new(query).parse
compiler = Oga::XPath::Compiler.new
block = compiler.compile(ast)
View oga_xpath_gt.rb
# Generated from XPath "20 > root/a"
lambda do |node, variables = nil|
op_left1 = begin
20.0
end
op_right2 = begin
catch(:value) do ||
node.children.each do |node|
if (node.is_a?(Oga::XML::Attribute) || node.is_a?(Oga::XML::Element)) && node.name == "root"
View dump.rb
trap 'USR2' do
Rubinius::VM.dump_heap("/tmp/rbx-#{Process.pid}.dump")
end
View oga_stress.rb
require 'oga'
require 'thread'
xml = <<-EOF
<people>
<person>
<name>Alice</name>
</person>
</people>
EOF
View gdb.txt
(gdb) r
Starting program: /home/yorickpeterse/.rubies/rbx-git/bin/rbx populate_queue.rb
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff1210700 (LWP 31314)]
Connecting...
Starting threads...
[New Thread 0x7fffd37d7700 (LWP 31320)]
[# ] [ 1910/6146778] [ 0.03%] [00:04] [04:11:05] [ 407.89/s][New Thread 0x7fffd13ce700 (LWP 31329)]
[New Thread 0x7fffd0bcc700 (LWP 31331)]
Something went wrong with that request. Please try again.