Skip to content

Instantly share code, notes, and snippets.

Avatar

Chuck Remes chuckremes

View GitHub Profile
View bt.txt
2: CXX machine/park.cpp
4: CXX machine/ontology.cpp
2: CXX machine/profiler.cpp
4: CXX machine/shared_state.cpp
2: CXX machine/signal.cpp
machine/shared_state.cpp:257:43: error: lambda capture 'state' is not used [-Werror,-Wunused-lambda-capture]
thread_nexus()->each_thread(state, [state](STATE, VM* vm) {
^
1 error generated.
Error: clang++ -I/Users/cremes/dev/mygit/rubinius/machine -I/Users/cremes/dev/mygit/rubinius/machine/include -I. -Imachine/test/cxxtest -I/Users/cremes/dev/mygit/rubinius/build/libraries/libsodium/src/libsodium/include -I/Users/cremes/dev/mygit/rubinius/build/libraries/libffi/include -Ibuild/libraries/double-conversion/src -DHAVE_CONFIG_H -I/Users/cremes/dev/mygit/rubinius/machine/include/capi -I/Users/cremes/dev/mygit/rubinius/build/libraries/oniguruma -I/Users/cremes/dev/mygit/rubinius/build/libraries/libtommath -pipe -fPIC -fno-omit-frame-pointer -g -mno-omit-leaf-frame-pointer -I/usr/local/opt/openssl/include -fPIC -D_DARWIN_USE_64_BIT_
View bt.txt
main # Rubinius::Loader at core/loader.rb:852 (+90)
script # Rubinius::Loader at core/loader.rb:667 (+343)
load_script # Rubinius::CodeLoader at core/code_loader.rb:280 (+60)
load # Rubinius::CodeLoader::Source(Rubinius::CodeLoader::Script) at core/code_loader.rb:119 (+81)
run_script # Rubinius::CodeLoader::Source(Rubinius::CodeLoader::Script) at core/code_loader.rb:132 (+21)
__script__ # Object at echo_tcp.rb:2 (+31)
require # Kernel(Object) at /Users/cremes/dev/mygit/rubinius/codedb/source/rubygems/core_ext/kernel_require.rb:59 (+176)
gem_original_require (require) # Kernel(Object) at core/kernel.rb:865 (+39)
require # Rubinius::CodeLoader at core/code_loader.rb:294 (+73)
load # Rubinius::CodeLoader::Feature at core/code_loader.rb:159 (+21)
View bench.txt
ruby 2.5.0
Comparison:
sync each, buffered: 104.9 i/s
async each, buffered: 96.6 i/s - same-ish: difference falls within error
async each, unbuffered: 95.7 i/s - same-ish: difference falls within error
sync each, unbuffered: 22.1 i/s - 4.74x slower
rubinius 3.90
View bench.rb
require 'benchmark/ips'
class Ak
def initialize(to:)
@to = to
end
def read(a:, b:, c:, d: nil)
@to.read(a: a, b: b, c: c, d: d)
end
View bench.txt
Charless-Air:ruby-io cremes$ ruby -v
rubinius 3.89.c15 (2.3.1 2ce10c98 2018-01-05 5.0.0) [x86_64-darwin16.7.0]
ACharless-Air:ruby-io cremes$ ruby benchmarks/keywords_vs_none.rb
Warming up --------------------------------------
keywords 467.000 i/100ms
nokeywords 2.710k i/100ms
Calculating -------------------------------------
keywords 4.970k (± 9.2%) i/s - 73.786k
nokeywords 30.586k (± 6.8%) i/s - 457.990k
View u.rb
file = File.open('/tmp/u', 'r')
file.each(5) do |line|
p line, file.pos
end
View vv
(lldb) p entries[i].prediction()->executable()->show(state)
#<Rubinius::Tuple:0x10c25e100>: 21
#<Encoding::UTF-8>
name: "UTF-8"
dummy?: false
>
#<Encoding::ASCII-8BIT>
name: "ASCII-8BIT"
dummy?: false
>
View frames
(lldb) up
frame #1: 0x0000000100066b8c rbx`rubinius::CallSite::Cache::poly_execute(state=0x000070000b08dc10, call_site=0x000000010c237d80, args=0x000070000b08bcf0) at call_site.hpp:223
220 cache->hit();
221 entries[i].hit();
222
-> 223 return entries[i].prediction()->executable()->execute(state,
224 entries[i].prediction()->executable(),
225 entries[i].prediction()->module(), args);
226 } else {
(lldb) p *cache
View bt.txt
...Process 73743 stopped
* thread #82, name = 'ruby.334', stop reason = EXC_BAD_ACCESS (code=1, address=0x12)
frame #0: 0x0000000000000012
error: memory read failed for 0x0
Target 0: (rbx) stopped.
(lldb) bt
* thread #82, name = 'ruby.334', stop reason = EXC_BAD_ACCESS (code=1, address=0x12)
* frame #0: 0x0000000000000012
frame #1: 0x0000000100066b8c rbx`rubinius::CallSite::Cache::poly_execute(state=0x000070000b08dc10, call_site=0x000000010c237d80, args=0x000070000b08bcf0) at call_site.hpp:223
frame #2: 0x0000000100190485 rbx`rubinius::instructions::send_stack(rubinius::State*, rubinius::CallFrame*, long, long) [inlined] rubinius::CallSite::execute(this=<unavailable>, state=0x000070000b08dc10, args=0x000000000000458e) at call_site.hpp:305 [opt]
View bt2.txt
Charless-Air:rubinius cremes$ build/rubinius/bin/rbx -v
Melbourne failed to load, Ruby source parsing disabled
rubinius 3.87 (2.3.1 24759319 2017-12-30 5.0.0 D) [x86_64-darwin16.7.0]
main # Rubinius::Loader at core/loader.rb:843
rubygems # Rubinius::Loader at core/loader.rb:588
load_rubygems . Rubinius::CodeLoader at core/code_loader.rb:202
require # Kernel(Class) at core/kernel.rb:852
require # Rubinius::CodeLoader at core/code_loader.rb:246
load # Rubinius::CodeLoader::Feature at core/code_loader.rb:121
load # Rubinius::CodeLoader::Source(Rubinius::CodeLoader::Feature) at core/code_loader.rb:83