This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[New Thread 0x7fffd33c6700 (LWP 20024)] | |
[Thread 0x7ffff7fbe740 (LWP 20016) exited] | |
[Inferior 1 (process 20016) exited with code 01] | |
Starting program: /home/yorickpeterse/.rubies/rbx-git/bin/ruby populate_queue.rb | |
[Thread debugging using libthread_db enabled] | |
Using host libthread_db library "/usr/lib/libthread_db.so.1". | |
[New Thread 0x7fffd33c6700 (LWP 20058)] | |
[Thread 0x7fffd33c6700 (LWP 20058) exited] | |
[New Thread 0x7fffd27c3700 (LWP 20061)] | |
[New Thread 0x7fffd2bc4700 (LWP 20060)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[New Thread 0x7fffd33c6700 (LWP 19899)] | |
[Thread 0x7fffd33c6700 (LWP 19899) exited] | |
[New Thread 0x7fffd27c3700 (LWP 19902)] | |
[New Thread 0x7fffd2bc4700 (LWP 19901)] | |
Program received signal SIGABRT, Aborted. | |
0x00007ffff62eb528 in raise () from /usr/lib/libc.so.6 | |
Id Target Id Frame | |
4 Thread 0x7fffd2bc4700 (LWP 19901) "ruby" 0x00007ffff728296f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 | |
3 Thread 0x7fffd27c3700 (LWP 19902) "ruby" 0x00007ffff7282d18 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[New Thread 0x7fffd33c6700 (LWP 19873)] | |
[Thread 0x7fffd33c6700 (LWP 19873) exited] | |
[New Thread 0x7fffd2bc4700 (LWP 19875)] | |
[New Thread 0x7fffd27c3700 (LWP 19876)] | |
Program received signal SIGSEGV, Segmentation fault. | |
[Switching to Thread 0x7fffd2bc4700 (LWP 19875)] | |
0x0000000000000000 in ?? () | |
Id Target Id Frame | |
4 Thread 0x7fffd27c3700 (LWP 19876) "ruby" 0x00007ffff7282d18 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Connecting... | |
Starting threads... | |
[New Thread 0x7fffd33c6700 (LWP 19746)] | |
[# ] [ 740/6126251] [ 0.01%] [00:03] [07:57:40] [ 213.73/s] | |
[Thread 0x7fffd33c6700 (LWP 19746) exited] | |
An exception occurred running populate_queue.rb | |
(Aws::SQS::Errors::SignatureDoesNotMatch) | |
Backtrace: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$:.unshift(File.expand_path('../lib', __FILE__)) | |
require 'oga' | |
require 'benchmark/ips' | |
require 'nokogiri' | |
query = 'foo/bar[baz]' | |
ast = Oga::XPath::Parser.new(query).parse | |
compiler = Oga::XPath::Compiler.new | |
block = compiler.compile(ast) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lambda do |node, variables = nil| | |
matched = Oga::XML::NodeSet.new | |
node.children.each do |node| | |
if (node.is_a?(Oga::XML::Attribute) || node.is_a?(Oga::XML::Element)) && node.name == "root" | |
node.children.each do |node| | |
if (node.is_a?(Oga::XML::Attribute) || node.is_a?(Oga::XML::Element)) && node.name == "a" | |
if catch(:predicate_matched) do || | |
node.children.each do |node| | |
if (node.is_a?(Oga::XML::Attribute) || node.is_a?(Oga::XML::Element)) && node.name == "b" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test, predicate = *ast | |
catch_arg = symbol(:predicate_matched) | |
process(test, input) do |matched_test_node| | |
catch_var = literal('predicate_matched') | |
catch_block = send_message('catch', catch_arg).add_block do | |
process(predicate, matched_test_node) do | |
send_message('throw', catch_arg, literal('true')) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ $ ruby /tmp/repro.rb | |
Starting... | |
NameError: uninitialized constant Seahorse::Client::Http::Request | |
const_missing at org/jruby/RubyModule.java:3118 | |
initialize at /home/yorickpeterse/Projects/ruby/aws-sdk-ruby/aws-sdk-core/lib/seahorse/client/request_context.rb:20 | |
context_for at /home/yorickpeterse/Projects/ruby/aws-sdk-ruby/aws-sdk-core/lib/seahorse/client/base.rb:90 | |
build_request at /home/yorickpeterse/Projects/ruby/aws-sdk-ruby/aws-sdk-core/lib/seahorse/client/base.rb:35 | |
block in get_queue_url at /home/yorickpeterse/Projects/ruby/aws-sdk-ruby/aws-sdk-core/lib/seahorse/client/base.rb:207 | |
block in /tmp/repro.rb at /tmp/repro.rb:15 | |
~ $ ruby /tmp/repro.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$:.unshift(File.expand_path('../lib', __FILE__)) | |
require 'ast' | |
require 'oga' | |
class Node | |
attr_reader :type | |
def initialize(type, children = []) | |
@type = type.to_sym |