Skip to content

Instantly share code, notes, and snippets.

View kbrock's full-sized avatar

Keenan Brock kbrock

View GitHub Profile
@kbrock
kbrock / answer.md
Last active August 29, 2017 13:44 — forked from aishfenton/serializer_benchmarks.rb
Performance comparison of different ruby serializer methods
gem
Json oj 40.4 i/s
MessagePack 38.3 i/s same
binary json 22.0 i/s 1.84x slower
Json yajl 19.0 i/s 2.13x slower
ruby json 15.6 i/s 2.59x slower
ruby marshal 13.9 i/s 2.90x slower
ruby yaml 0.4 i/s 111.99x slower
Yaml Psych 0.4 i/s 112.09x slower
@kbrock
kbrock / complie.sh
Last active September 8, 2015 15:16 — forked from havenwood/hello.cr
"Hello, world!" from MRuby embedded in Crystal
export MRUBY_HOME=/opt/rubies/mruby-20150906
crystal run --link-flags -L${MRUBY_HOME}/lib/ hello.cr
#!/usr/bin/env ruby
require 'nokogiri'
src =<<EOD
<wrapper xmlns="ns" xmlns:extra="extra">
<record xml:id="r1">
<field>aaa</field>
<field extra:type="second">bbb</field>
</record>