Skip to content

Instantly share code, notes, and snippets.

Masahiro Nakagawa repeatedly

Block or report user

Report or block repeatedly

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ruby 2.3.5p376 (2017-09-14 revision 59905) [x86_64-linux]
built-in mem: 178476 duration: 5.132209188
jemalloc 3.0.0 mem: 176224 duration: 4.000590038
jemalloc 3.1.0 mem: 176228 duration: 3.905287789
jemalloc 3.2.0 mem: 181496 duration: 3.884209287
jemalloc 3.3.0 mem: 181512 duration: 3.993662677
jemalloc 3.3.1 mem: 183572 duration: 3.883753324
jemalloc 3.4.0 mem: 181564 duration: 3.92800123
jemalloc 3.4.1 mem: 181500 duration: 3.842475057
repeatedly /
Created Nov 19, 2017 Timer result between 2.4 and 2.5


% ruby --version
ruby 2.5.0dev (2017-11-18 trunk 60833) [x86_64-darwin15]

% ruby timer_test.rb
Traceback (most recent call last):
        3: from t_test.rb:16:in `<main>'
        2: from /Users/repeatedly/.rbenv/versions/2.5.0-dev/lib/ruby/gems/2.5.0/gems/ `run'
repeatedly /
Created Sep 7, 2017
rubygems 2.4.8と2.5.0以降の依存解決の違い

gem 2.4.8

  • with pre activesupport 4.2.8 installation
% gem i draper -v 1.4.0 --no-doc --explain
Gems to install:
repeatedly / dig_bench.rb
Created Jul 19, 2017
dig benchmark for fluentd
View dig_bench.rb
require 'benchmark'
class Test0
def initialize(key)
@key = key
def call(record)
repeatedly / fluent.conf
Last active Nov 29, 2019
Fluentd: HTTP input simple benchmark
View fluent.conf
@type http
port 8888
<match test.**>
@type flowcounter_simple
repeatedly / fluent.conf
Last active Nov 15, 2016
Sync like file transfer with v0.14
View fluent.conf
@type tail
path in/*.log
path_key tailed_path
read_from_head true
tag logs.tail
@type none
View out_elasticsearch2.rb
# encoding: UTF-8
require 'date'
require 'excon'
require 'elasticsearch'
require 'uri'
require 'strptime'
rescue LoadError

Build step on CentOS5

Use /home/repeatedly/lib for installation directory. Change the path on your environment.

Setup Ruby

Download openssl, zlib and ruby on host and copy to CentOS5

$ pwd
repeatedly / json_decode.rb
Created Dec 16, 2015
JSON encode / decode comparison
View json_decode.rb
# Result
#invalid utf-8 with US-ASCII
#"Yajl: error: lexical error: invalid bytes in UTF8 string.\n # {\"k\":\"v\xFFvv\"}\n (right here) ------^\n"
View bench_hash_to_proc.rb
require 'benchmark'
hash = { a: 1, b: 2, c: 3 }
keys = %i[a c d]
hash_proc = hash.to_proc
n = 500000
Benchmark.bmbm do |x|'&hash') { n.times do
You can’t perform that action at this time.