Last active
          May 26, 2017 16:42 
        
      - 
      
- 
        Save spraints/aec9c5bcf0638f7e3a8f192a1752cd00 to your computer and use it in GitHub Desktop. 
  
    
      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
    
  
  
    
  | require "benchmark/ips" | |
| require "mochilo" | |
| system "uname -a" | |
| puts "ruby #{RUBY_VERSION}" | |
| Benchmark.ips do |x| | |
| enc_opts = {Symbol => [0x01, lambda { |sym| sym.to_s }]} | |
| dec_opts = {0x01 => lambda { |raw| raw.to_sym }} | |
| str = ["a string"] * 100 | |
| sym = [:symbol] * 100 | |
| x.report("string") { Mochilo.unpack(Mochilo.pack(str)) } | |
| x.report("symbol") { Mochilo.unpack(Mochilo.pack(sym, enc_opts), dec_opts) } | |
| 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
    
  
  
    
  | source "https://rubygems.org" | |
| gem "mochilo", :git => "https://github.com/spraints/mochilo", :ref => "custom-type-registry" | |
| gem "benchmark-ips" | 
  
    
      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
    
  
  
    
  | GIT | |
| remote: https://github.com/spraints/mochilo | |
| revision: 458fcb528b704bae7bff074d9aa27ee2ccb9449d | |
| ref: custom-type-registry | |
| specs: | |
| mochilo (2.0) | |
| GEM | |
| remote: https://rubygems.org/ | |
| specs: | |
| benchmark-ips (2.7.2) | |
| PLATFORMS | |
| ruby | |
| DEPENDENCIES | |
| benchmark-ips | |
| mochilo! | |
| BUNDLED WITH | |
| 1.14.6 | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment