Skip to content

Instantly share code, notes, and snippets.

View 284km's full-sized avatar

Kazuma Furuhashi 284km

View GitHub Profile
@284km
284km / StringScanner#scan が思ったより遅いことについて考えていた.md
Last active December 8, 2018 08:18
StringScanner#scan が思ったより遅いことについて考えていた.md
# $ ruby strscan_split.rb
# Warming up --------------------------------------
#                split    14.000  i/100ms
#              strscan     4.000  i/100ms
#   strscan without <<     5.000  i/100ms
# strscan w/o << regex     5.000  i/100ms
#    strscan w/o split     4.000  i/100ms
#            strscan.*    32.000  i/100ms
@284km
284km / ccsv_test.md
Created December 8, 2018 07:32
ccsv は速いけど単純に ruby/csv と比較できなかった.md

result

Run options: 

# Running tests:


 1) Failure:
@284km
284km / gist:56b4e8444e8778ed8132ef663a93f5dc
Last active December 4, 2018 17:45
benchmark of "Replace with flexible CSV parser"
```
$ rake
Run options:
# Running tests:
Finished tests in 1.893467s, 224.9841 tests/s, 4058.1642 assertions/s.
426 tests, 7684 assertions, 0 failures, 0 errors, 0 skips
ruby -v: ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]
@284km
284km / apache_arrow_20181010.md
Last active November 29, 2018 05:16
[English translation of selfishly] Apache Arrow 0.11.0 Released (October 10, 2018) by Sutou-san

Original article

Apache Arrow 0.11.0 Released (October 10, 2018)

The original Japanese article was written by Kouhei Sutou, a member of Apache Arrow PMC. He was the release manager of Apache Arrow 0.11.0.

We released Apache Arrow 0.11.0 on October 8, 2018.

@284km
284km / apache_arrow_20180905.md
Last active November 28, 2018 05:21
[English translation of selfishly] The latest information on Apache Arrow (September 5, 2018) by Sutou-san

Original article

The latest information on Apache Arrow (September 5, 2018)

Do you know Apache Arrow? Most people probably do not hear or know only the name or only the concept. There will be few people who have actually experienced it. Apache Arrow is a project that will become an important component in the data processing in a few years. People who are interested in the data processing should be useful to know, so I will introduce the latest information as of September 2018.

I'm the only Japanese in PMC and the number of commits is the third most. Maybe I'm familiar with Apache Arrow in Japan. Since there is not much information on Apache Arrow in Japanese, I will introduce it in Japanese. Incidentally, there are various information in English. Useful information sources include the official blog of Apache Arrow, [

@284km
284km / ips.md
Created May 31, 2018 07:18
libcsv/csv ips
# 5 columns, 10,000 rows

Warming up --------------------------------------
            unquoted     1.000  i/100ms
              quoted     1.000  i/100ms
   (libcsv) unquoted     1.000  i/100ms
     (libcsv) quoted     1.000  i/100ms
Calculating -------------------------------------
@284km
284km / memory_usage.md
Last active May 30, 2018 18:39
(csv / libcsv) memory usage
### 10 columns, 1,000,000 lines

Calculating -------------------------------------
            unquoted     1.397B memsize (    61.000M retained)
                        16.000M objects (     2.000  retained)
                        28.000  strings (     1.000  retained)
              quoted     1.857B memsize (    81.000M retained)
                        26.000M objects (     2.000  retained)
                        29.000  strings (     1.000  retained)
diff --git a/Gemfile b/Gemfile
index 9d19ebf..2f56cf4 100644
--- a/Gemfile
+++ b/Gemfile
@@ -14,13 +14,6 @@ gem 'pg', '>= 0.18', '< 2.0'
 gem 'puma', '~> 3.7'
 # Use SCSS for stylesheets
 gem 'sass-rails', '~> 5.0'
@284km
284km / ternary_equal_notequal.rb
Created February 21, 2018 05:24
分かってはいたがまあやってみて、same-ish だった。
require 'benchmark/ips'
def ternary_equal
(true == true) ? true : false
end
def ternary_not_equal
(true != false) ? true : false
end
@284km
284km / sicp_2_23.scm
Last active January 26, 2018 07:20
SICP の 2.23 の練習問題のやつ.scm
(define (for-each proc items)
(if (null? items)
#f
(begin
(proc (car items))
(for-each proc (cdr items)))
)
)
(for-each (lambda (x) (newline) (display x)) (list 57 321 88))