rabbit-slide-kou-rubykaigi-2019 2019.4.19.0 → 2019.4.19.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config.yaml +2 -1
- data/csv.rab +500 -31
- data/images/speee-rubykaigi-2019-cafe-sponsor.png +0 -0
- data/pdf/rubykaigi-2019-csv.pdf +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e221fe9bf7f94889fc89060ff8e9be02211e3033ba3a0a1e3cf92070cc5a2d6a
|
4
|
+
data.tar.gz: aeb62998f66445093d09e3651199637314b8e15d340cdb2ba1b6ac95bdc2ad21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 402e69c2537dcdc4d7badb0506c01f440fcb59fd8d0ffe5ac5372c50a22d0aed32a0456f3062270d7672d7cdccddbf82b0febc984aeff9e23d19bc8e9891da9b
|
7
|
+
data.tar.gz: 9a1a31fadae5799e381dfcc3eabb1563fc714694139db8a4c827251957e877dad2f9b2286c52f37d77542609fea360a3118200c4a8174e07eb056000d7eb70a1
|
data/config.yaml
CHANGED
data/csv.rab
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
= Better CSV processing\nwith Ruby 2.6
|
2
2
|
|
3
3
|
: author
|
4
|
-
Kouhei Sutou
|
4
|
+
Kouhei Sutou/Kazuma Furuhashi
|
5
5
|
: institution
|
6
|
-
ClearCode Inc.
|
6
|
+
ClearCode Inc./Speee, Inc.
|
7
7
|
: content-source
|
8
8
|
RubyKaigi 2019
|
9
9
|
: date
|
@@ -27,22 +27,34 @@
|
|
27
27
|
: enable-title-on-image
|
28
28
|
false
|
29
29
|
|
30
|
-
=
|
30
|
+
= Ad: Cafe sponsor
|
31
|
+
|
32
|
+
# img
|
33
|
+
# src = images/speee-rubykaigi-2019-cafe-sponsor.png
|
34
|
+
# relative_height = 100
|
35
|
+
# reflect_ratio = 0.1
|
36
|
+
|
37
|
+
== Slide properties
|
38
|
+
|
39
|
+
: enable-title-on-image
|
40
|
+
false
|
41
|
+
|
42
|
+
= Kouhei Sutou
|
31
43
|
|
32
44
|
* The president of ClearCode Inc.\n
|
33
45
|
(('note:クリアコードの社長'))
|
34
46
|
* A new maintainer of the (({csv})) library\n
|
35
47
|
(('note:(({csv}))ライブラリーの新メンテナー'))
|
36
|
-
* The founder of ((<Red Data Tools|URL:https://red-data-tools.github.io/>)) project
|
48
|
+
* The founder of ((<Red Data Tools|URL:https://red-data-tools.github.io/>)) project\n
|
37
49
|
(('note:Red Data Toolsプロジェクトの立ち上げ人'))
|
38
50
|
* Provides data processing tools for Ruby\n
|
39
51
|
(('note:Ruby用のデータ処理ツールを提供するプロジェクト'))
|
40
52
|
|
41
53
|
= Kazuma Furuhashi
|
42
54
|
|
43
|
-
*
|
55
|
+
* TODO: Kazuma part
|
44
56
|
|
45
|
-
=
|
57
|
+
= csv in Ruby 2.6 (1)\n(('note:Ruby 2.6のcsv(1)'))
|
46
58
|
|
47
59
|
Faster CSV parsing\n
|
48
60
|
(('note:CSVパースの高速化'))
|
@@ -69,7 +81,7 @@ Faster CSV parsing\n
|
|
69
81
|
|
70
82
|
274.1i/s, 534.5i/s, 1.95x
|
71
83
|
|
72
|
-
= Quoted separator CSV (1)\n(('note:区切り文字をクォートしているCSV
|
84
|
+
= Quoted separator CSV (1)\n(('note:区切り文字をクォートしているCSV(1)'))
|
73
85
|
|
74
86
|
",AAAAA",",AAAAA",",AAAAA"
|
75
87
|
...
|
@@ -80,7 +92,7 @@ Faster CSV parsing\n
|
|
80
92
|
|
81
93
|
211.0i/s, 330.0/s, 1.56x
|
82
94
|
|
83
|
-
= Quoted separator CSV (2)\n(('note:区切り文字をクォートしているCSV
|
95
|
+
= Quoted separator CSV (2)\n(('note:区切り文字をクォートしているCSV(2)'))
|
84
96
|
|
85
97
|
"AAAAA\r\n","AAAAA\r\n","AAAAA\r\n"
|
86
98
|
...
|
@@ -102,6 +114,8 @@ Faster CSV parsing\n
|
|
102
114
|
Include sep2, 118.0i/s, 325.6i/s
|
103
115
|
(Note), (Slow down), (Still fast)
|
104
116
|
|
117
|
+
(('note:Note: "Just quoted" on 2.6 is optimized'))
|
118
|
+
|
105
119
|
= Multibyte CSV\n(('note:マルチバイトのCSV'))
|
106
120
|
|
107
121
|
あああああ,あああああ,あああああ
|
@@ -113,7 +127,7 @@ Faster CSV parsing\n
|
|
113
127
|
|
114
128
|
371.2i/s, 626.6i/s, 1.69x
|
115
129
|
|
116
|
-
=
|
130
|
+
= csv in Ruby 2.6 (2)\n(('note:Ruby 2.6のcsv(2)'))
|
117
131
|
|
118
132
|
Faster CSV writing\n
|
119
133
|
(('note:CSV書き出しの高速化'))
|
@@ -159,7 +173,7 @@ Faster CSV writing\n
|
|
159
173
|
((*Use (({<<})) for multiple writes*))\n
|
160
174
|
(('note:((*複数行書き出すときは(({<<}))を使うこと*))'))
|
161
175
|
|
162
|
-
=
|
176
|
+
= csv in Ruby 2.6 (3)\n(('note:Ruby 2.6のcsv(3)'))
|
163
177
|
|
164
178
|
New CSV parser\n
|
165
179
|
(('tag:small:for'))\n
|
@@ -244,21 +258,26 @@ Limitation: No quote\n
|
|
244
258
|
* Use (({CSV#<<})) than (({CSV.generate_line}))\n
|
245
259
|
(('note:(({CSV.generate_line}))よりも(({CSV#<<}))を使うこと'))
|
246
260
|
|
247
|
-
= How to improve performance (1)
|
261
|
+
= How to improve performance (1)\n(('note:速度改善方法(1)'))
|
248
262
|
|
249
|
-
Complex quote
|
263
|
+
Complex quote\n
|
264
|
+
(('note:複雑なクォート'))
|
250
265
|
|
251
|
-
= Complex quote
|
266
|
+
= Complex quote\n(('note:複雑なクォート'))
|
252
267
|
|
253
268
|
"AA""AAA"
|
254
269
|
"AA,AAA"
|
255
270
|
"AA\rAAA"
|
256
271
|
"AA\nAAA"
|
257
272
|
|
258
|
-
= Use (({StringScanner}))
|
273
|
+
= Use (({StringScanner}))\n(('note:(({StringScanner}))を使う'))
|
274
|
+
|
275
|
+
* (({String#split})) is very fast\n
|
276
|
+
(('note:(({String#split}))は高速'))
|
277
|
+
* (({String#split})) is naive for complex quote\n
|
278
|
+
(('note:(({String#split}))は複雑なクォートを処理するには単純過ぎる'))
|
259
279
|
|
260
|
-
|
261
|
-
* But it's naive for complex quote
|
280
|
+
= TODO: Kazuma part start
|
262
281
|
|
263
282
|
= 2.5 uses (({String#split}))
|
264
283
|
|
@@ -350,6 +369,10 @@ Slow down
|
|
350
369
|
(('tag:center'))
|
351
370
|
Easy to maintain
|
352
371
|
|
372
|
+
= Point (1)\n(('note:ポイント(1)'))
|
373
|
+
|
374
|
+
...
|
375
|
+
|
353
376
|
= Parsing complex quote with (({StringScanner}))
|
354
377
|
|
355
378
|
# RT
|
@@ -361,32 +384,478 @@ Easy to maintain
|
|
361
384
|
(('tag:center'))
|
362
385
|
No slow down...?
|
363
386
|
|
364
|
-
=
|
387
|
+
= TODO: Kazuma part end
|
365
388
|
|
366
|
-
|
389
|
+
= How to improve performance (2)\n(('note:速度改善方法(2)'))
|
367
390
|
|
368
|
-
|
391
|
+
Simple case\n
|
392
|
+
(('note:単純なケース'))
|
393
|
+
|
394
|
+
= Simple case\n(('note:単純なケース'))
|
369
395
|
|
370
396
|
AAAAA
|
371
397
|
"AAAAA"
|
372
398
|
|
373
|
-
= Use (({String#split}))
|
399
|
+
= Use (({String#split}))\n(('note:(({String#split}))を使う'))
|
374
400
|
|
375
401
|
(({StringScanner})) is\n
|
376
|
-
slow
|
377
|
-
simple case
|
402
|
+
slow\n
|
403
|
+
for simple case\n
|
404
|
+
(('note:(({StringScanner}))は単純なケースでは遅い'))
|
378
405
|
|
379
|
-
=
|
406
|
+
= Fallback to (({StringScanner})) impl.\n(('note:(({StringScanner}))実装にフォールバック'))
|
380
407
|
|
381
|
-
|
382
|
-
* Reconstructed test suites for further improvements
|
383
|
-
* Benchmark suites for further performance improvements
|
408
|
+
# rouge ruby
|
384
409
|
|
385
|
-
|
410
|
+
def parse_by_strip(&block)
|
411
|
+
@input.each_line do |line|
|
412
|
+
if complex?(line)
|
413
|
+
return parse_by_string_scanner(&block)
|
414
|
+
else
|
415
|
+
yield(line.split(","))
|
416
|
+
end
|
417
|
+
end
|
418
|
+
end
|
386
419
|
|
387
|
-
|
420
|
+
= Quoted CSVs\n(('note:クォートありのCSV'))
|
421
|
+
|
422
|
+
# RT
|
423
|
+
|
424
|
+
, (({StringScanner})), (({split})) + (({StringScanner}))
|
425
|
+
|
426
|
+
Just quoted, 311.7i/s, (('tag:right'))((*523.4i/s*))
|
427
|
+
Include sep1, 312.9i/s, 309.8i/s
|
428
|
+
Include sep2, 311.3i/s, 312.6i/s
|
429
|
+
|
430
|
+
= Point (2)\n(('note:ポイント(2)'))
|
431
|
+
|
432
|
+
* First try optimized version\n
|
433
|
+
(('note:まず最適化バージョンを試す'))
|
434
|
+
* Fallback to robust version\n
|
435
|
+
when complexity is detected\n
|
436
|
+
(('note:複雑だとわかったらちゃんとしたバージョンにフォールバック'))
|
437
|
+
|
438
|
+
= How to improve performance (3)\n(('note:速度改善方法(3)'))
|
439
|
+
|
440
|
+
(({loop do}))\n
|
441
|
+
↓\n
|
442
|
+
(({while true}))
|
443
|
+
|
444
|
+
= (({loop})) vs. (({while}))
|
445
|
+
|
446
|
+
# RT
|
447
|
+
|
448
|
+
How, Throughput
|
449
|
+
|
450
|
+
(({loop})), 377i/s
|
451
|
+
(({while})), 401i/s
|
452
|
+
|
453
|
+
= Point (3)\n(('note:ポイント(3)'))
|
454
|
+
|
455
|
+
* (({while})) doesn't create a new scope\n
|
456
|
+
(('note:(({while}))は新しいスコープを作らない'))
|
457
|
+
* Normally, you can use (({loop}))\n
|
458
|
+
(('note:ふつうは(({loop}))でよい'))
|
459
|
+
* Normally, (({loop})) isn't bottle neck\n
|
460
|
+
(('note:ふつうは(({loop}))がボトルネックにはならない'))
|
461
|
+
|
462
|
+
= How to improve performance (4)\n(('note:速度改善方法(4)'))
|
463
|
+
|
464
|
+
Lazy\n
|
465
|
+
(('note:遅延'))
|
466
|
+
|
467
|
+
= (({CSV})) object is parser and writer\n(('note:(({CSV}))オブジェクトは読み書きできる'))
|
468
|
+
|
469
|
+
* 2.5: Always initializes everything\n
|
470
|
+
(('note:2.5:常にすべてを初期化'))
|
471
|
+
* 2.6: Initializes when it's needed\n
|
472
|
+
(('note:2.6:必要になったら初期化'))
|
473
|
+
|
474
|
+
= Write performance
|
475
|
+
|
476
|
+
# RT
|
477
|
+
|
478
|
+
, 2.5, 2.6, Faster?
|
479
|
+
|
480
|
+
(({generate_\nline})), 284.4i/s, 684.2i/s, 2.41x
|
481
|
+
(({<<})), 2891.4i/s, 4824.1i/s, 1.67x
|
482
|
+
|
483
|
+
= Point (4)\n(('note:ポイント(4)'))
|
484
|
+
|
485
|
+
* Do only needed things\n
|
486
|
+
(('note:必要なことだけする'))
|
487
|
+
* One class for one feature\n
|
488
|
+
(('note:機能ごとにクラスを分ける'))
|
489
|
+
|
490
|
+
= New features by new parser\n(('note:新しいパーサーによる新機能'))
|
491
|
+
|
492
|
+
* Add support for \" escape\n
|
493
|
+
(('note:\\"でのエスケープをサポート'))
|
494
|
+
* Add (({strip:})) option\n
|
495
|
+
(('note:(({strip:}))オプションを追加'))
|
496
|
+
|
497
|
+
= \" escape\n(('note:\\"でのエスケープ'))
|
498
|
+
|
499
|
+
# rouge ruby
|
500
|
+
|
501
|
+
CSV.parse(%Q["a""bc","a\\"bc"],
|
502
|
+
liberal_parsing: {backslash_quote: true})
|
503
|
+
# [["a\\"bc", "a\\"bc"]]
|
504
|
+
|
505
|
+
= TODO: Kazuma part start
|
506
|
+
|
507
|
+
= TODO: Kazuma part end
|
508
|
+
|
509
|
+
= (({strip:}))\n(('note:(({strip:}))'))
|
510
|
+
|
511
|
+
# rouge ruby
|
512
|
+
|
513
|
+
CSV.parse(%Q[ abc , " abc"], strip: true)
|
514
|
+
# [["abc", " abc"]]
|
515
|
+
CSV.parse(%Q[abca,abc], strip: "a")
|
516
|
+
# [["bc", "bc"]]
|
517
|
+
|
518
|
+
= csv in Ruby 2.6 (4)\n(('note:Ruby 2.6のcsv(4)'))
|
519
|
+
|
520
|
+
Keep backward compatibility\n
|
521
|
+
(('note:互換性を維持'))
|
522
|
+
|
523
|
+
= How to keep backward compat.\n(('note:互換性を維持する方法'))
|
524
|
+
|
525
|
+
* Reconstruct test suites\n
|
526
|
+
(('note:テストを整理'))
|
527
|
+
* Add benchmark suites\n
|
528
|
+
(('note:ベンチマークを追加'))
|
529
|
+
|
530
|
+
= Test\n(('note:テスト'))
|
531
|
+
|
532
|
+
* Important to detect incompat.\n
|
533
|
+
(('note:非互換の検出のために重要'))
|
534
|
+
* Must be easy to maintain\n
|
535
|
+
(('note:メンテナンスしやすくしておくべき'))
|
536
|
+
* To keep developing\n
|
537
|
+
(('note:継続的な開発するため'))
|
538
|
+
|
539
|
+
= How to reconstruct test (1)\n(('note:テストを整理する方法(1)'))
|
540
|
+
|
541
|
+
One assertion\n
|
542
|
+
than\n
|
543
|
+
multiple assertions\n
|
544
|
+
(('note:複数アサーションより一発アサーション'))
|
545
|
+
|
546
|
+
= One assertion\n(('note:一発アサーション'))
|
547
|
+
|
548
|
+
# rouge ruby
|
549
|
+
|
550
|
+
# Multiple assertions
|
551
|
+
CSV.foreach do |row|
|
552
|
+
assert_equal(@rows.shift, row)
|
553
|
+
end
|
554
|
+
# One assertion
|
555
|
+
rows = CSV.foreach.to_a
|
556
|
+
assert_equal(@rows, rows)
|
557
|
+
|
558
|
+
= Why\n(('note:理由'))
|
559
|
+
|
560
|
+
Easy to debug\n
|
561
|
+
on failure\n
|
562
|
+
(('note:失敗時にデバッグしやすい'))
|
563
|
+
|
564
|
+
= On failure: Multiple assertions\n(('note:失敗時:複数アサーション'))
|
565
|
+
|
566
|
+
# rouge ruby
|
567
|
+
|
568
|
+
rows = [1, 2, 3]
|
569
|
+
[1, 4, 3].each do |row|
|
570
|
+
assert_equal(rows.shift, row)
|
571
|
+
end
|
572
|
+
# <2> expected but was
|
573
|
+
# <4>
|
574
|
+
# Is the N-th row wrong?
|
575
|
+
|
576
|
+
= On failure: One assertion\n(('note:失敗時:一発アサーション'))
|
577
|
+
|
578
|
+
# rouge ruby
|
579
|
+
|
580
|
+
rows = [1, 2, 3]
|
581
|
+
assert_equal(rows, [1, 4, 3])
|
582
|
+
# <[1, 2, 3]> expected but was
|
583
|
+
# <[1, 4, 3]>
|
584
|
+
# diff:
|
585
|
+
# ? [1, 2, 3]
|
586
|
+
# ? 4
|
587
|
+
|
588
|
+
= How to reconstruct test (2)\n(('note:テストを整理する方法(2)'))
|
589
|
+
|
590
|
+
Multiple tests\n
|
591
|
+
than\n
|
592
|
+
one test\n
|
593
|
+
(('note:一発テストより複数テスト'))
|
594
|
+
|
595
|
+
= One test\n(('note:一発テスト'))
|
596
|
+
|
597
|
+
# rouge ruby
|
598
|
+
|
599
|
+
# How many checks in this test?
|
600
|
+
def test_open_and_close
|
601
|
+
csv = CSV.open(@path, "r+", col_sep: "\t", row_sep: "\r\n")
|
602
|
+
assert_not_nil(csv)
|
603
|
+
assert_instance_of(CSV, csv)
|
604
|
+
assert_not_predicate(csv, :closed?)
|
605
|
+
csv.close
|
606
|
+
assert_predicate(csv, :closed?)
|
607
|
+
|
608
|
+
ret = CSV.open(@path) do |new_csv|
|
609
|
+
csv = new_csv
|
610
|
+
assert_instance_of(CSV, new_csv)
|
611
|
+
"Return value."
|
612
|
+
end
|
613
|
+
assert_predicate(csv, :closed?)
|
614
|
+
assert_equal("Return value.", ret)
|
615
|
+
end
|
616
|
+
|
617
|
+
= Multiple tests (1)\n(('note:複数テスト(1)'))
|
618
|
+
|
619
|
+
# rouge ruby
|
620
|
+
|
621
|
+
def test_closed?
|
622
|
+
csv = CSV.open(@path, "r+", col_sep: "\t", row_sep: "\r\n")
|
623
|
+
assert_not_nil(csv)
|
624
|
+
assert_instance_of(CSV, csv)
|
625
|
+
assert_not_predicate(csv, :closed?)
|
626
|
+
csv.close
|
627
|
+
assert_predicate(csv, :closed?)
|
628
|
+
end
|
629
|
+
|
630
|
+
= Needless assertions\n(('note:必要のないアサーション'))
|
631
|
+
|
632
|
+
# rouge ruby
|
633
|
+
|
634
|
+
def test_closed?
|
635
|
+
csv = CSV.open(@path, "r+", col_sep: "\t", row_sep: "\r\n")
|
636
|
+
assert_not_nil(csv) # <- Needless
|
637
|
+
assert_instance_of(CSV, csv) # <- Needless
|
638
|
+
assert_not_predicate(csv, :closed?) # <- This can detect
|
639
|
+
csv.close
|
640
|
+
assert_predicate(csv, :closed?)
|
641
|
+
end
|
642
|
+
|
643
|
+
= Multiple tests (1)\n(('note:複数テスト(1)'))
|
644
|
+
|
645
|
+
# rouge ruby
|
646
|
+
|
647
|
+
def test_closed?
|
648
|
+
csv = CSV.open(@path, "r+", col_sep: "\t", row_sep: "\r\n")
|
649
|
+
assert_not_predicate(csv, :closed?)
|
650
|
+
csv.close
|
651
|
+
assert_predicate(csv, :closed?)
|
652
|
+
end
|
653
|
+
|
654
|
+
= Multiple tests (2)\n(('note:複数テスト(2)'))
|
655
|
+
|
656
|
+
# rouge ruby
|
657
|
+
|
658
|
+
def test_open_auto_close
|
659
|
+
csv = nil
|
660
|
+
CSV.open(@input.path) do |new_csv|
|
661
|
+
csv = new_csv
|
662
|
+
end
|
663
|
+
assert_predicate(csv, :closed?)
|
664
|
+
end
|
665
|
+
|
666
|
+
= Multiple tests (3)\n(('note:複数テスト(3)'))
|
667
|
+
|
668
|
+
# rouge ruby
|
669
|
+
|
670
|
+
def test_open_block_return_value
|
671
|
+
return_value = CSV.open(@input.path) do
|
672
|
+
"Return value."
|
673
|
+
end
|
674
|
+
assert_equal("Return value.", return_value)
|
675
|
+
end
|
676
|
+
|
677
|
+
= Why\n(('note:理由'))
|
678
|
+
|
679
|
+
Easy to maintain\n
|
680
|
+
(('note:メンテナンスしやすい'))
|
681
|
+
|
682
|
+
= Easy to maintenance\n(('note:メンテナンスしやすい状態'))
|
683
|
+
|
684
|
+
* Easy to understand each test\n
|
685
|
+
(('note:各テストを理解しやすい'))
|
686
|
+
* Easy to run each test\n
|
687
|
+
(('note:各テストを個別に実行しやすい'))
|
688
|
+
* Focusing a failed case is easy to debug\n
|
689
|
+
(('note:失敗したケースに集中できるとデバッグしやすい'))
|
690
|
+
|
691
|
+
= How to reconstruct test (4)\n(('note:テストを整理する方法(4)'))
|
692
|
+
|
693
|
+
Simplify\n
|
694
|
+
(('note:単純にする'))
|
695
|
+
|
696
|
+
= Test writing\n(('note:書き込みテスト'))
|
697
|
+
|
698
|
+
# rouge ruby
|
699
|
+
|
700
|
+
lines = [{a: 1, b: 2, c: 3}, {a: 4, b: 5, c: 6}]
|
701
|
+
CSV.open(@path, "wb", headers: true) do |csv|
|
702
|
+
csv << lines.first.keys
|
703
|
+
lines.each {|line| csv << line}
|
704
|
+
end
|
705
|
+
CSV.open(@path, "rb", headers: true) do |csv|
|
706
|
+
csv.each {|line| assert_equal(lines.shift, line.to_hash)}
|
707
|
+
end
|
708
|
+
|
709
|
+
= Simplify\n(('note:単純にする'))
|
710
|
+
|
711
|
+
# rouge ruby
|
712
|
+
|
713
|
+
CSV.open(@path, "wb", headers: true) do |csv|
|
714
|
+
csv << [:a, :b, :c] # Use literal
|
715
|
+
csv << {a: 1, b: 2, c: 3} # Use literal
|
716
|
+
csv << {a: 4, b: 5, c: 6} # Use literal
|
717
|
+
end
|
718
|
+
# Use literal and don't parse
|
719
|
+
assert_equal(<<-CSV, File.read(@path, mode: "rb"))
|
720
|
+
a,b,c
|
721
|
+
1,2,3
|
722
|
+
4,5,6
|
723
|
+
CSV
|
724
|
+
|
725
|
+
= Summary: Test\n(('note:まとめ:テスト'))
|
726
|
+
|
727
|
+
* Important for keeping backward compat.\n
|
728
|
+
(('note:互換性を維持するために重要'))
|
729
|
+
* Keep tests easy to maintain\n
|
730
|
+
for continuous development\n
|
731
|
+
(('note:継続的に開発するためにメンテナンスしやすいテストを維持'))
|
732
|
+
|
733
|
+
= Benchmark\n(('note:ベンチマーク'))
|
734
|
+
|
735
|
+
* Important to detect\n
|
736
|
+
performance regression ((*bugs*))\n
|
737
|
+
(('note:性能劣化((*バグ*))を検出するために重要'))
|
738
|
+
|
739
|
+
= TODO: Kazuma part start
|
740
|
+
|
741
|
+
= TODO: Kazuma part end
|
742
|
+
|
743
|
+
= Summary: Benchmark\n(('note:まとめ:ベンチマーク'))
|
744
|
+
|
745
|
+
* Join csv developing!\n
|
746
|
+
(('note:csvの開発に参加しよう!'))
|
747
|
+
* Adding a new benchmark is a good start\n
|
748
|
+
(('note:ベンチマークの追加から始めるのはどう?'))
|
749
|
+
* We'll focus on improving performance for benchmark cases\n
|
750
|
+
(('note:ベンチマークが整備されているケースの性能改善に注力するよ'))
|
751
|
+
|
752
|
+
= How to use improved csv?\n(('note:改良されたcsvを使う方法'))
|
753
|
+
|
754
|
+
(({gem install csv}))
|
755
|
+
|
756
|
+
= CSV in Ruby 2.5\n(('note:Ruby 2.5のCSV'))
|
757
|
+
|
758
|
+
Default gemified\n
|
759
|
+
(('note:デフォルトgem化'))
|
760
|
+
|
761
|
+
= Default gem\n(('note:デフォルトgem'))
|
762
|
+
|
763
|
+
* Similar to plain standard library\n
|
764
|
+
(('note:通常の標準添付ライブラリーと似ている'))
|
765
|
+
* Similar to bundled gem\n
|
766
|
+
(('note:バンドルgemと似ている'))
|
767
|
+
|
768
|
+
= Plain standard library\n(('note:通常の標準添付ライブラリー'))
|
769
|
+
|
770
|
+
* Can use it just by (({require}))\n
|
771
|
+
(('note:(({require}))するだけで使える'))
|
772
|
+
* Can use it without entry in (({Gemfile}))\n
|
773
|
+
(('note:(({Gemfile}))に書かなくても使える'))
|
774
|
+
* Can't upgrade it by (({gem}))\n
|
775
|
+
(('note:(({gem}))でアップグレードできない'))
|
776
|
+
* e.g.: dRuby
|
777
|
+
|
778
|
+
= Default gem\n(('note:デフォルトgem'))
|
779
|
+
|
780
|
+
* Can use it just by (({require}))\n
|
781
|
+
(('note:(({require}))するだけで使える'))
|
782
|
+
* Can use it without entry in (({Gemfile}))\n
|
783
|
+
(('note:(But you use it bundled in your Ruby)'))\n
|
784
|
+
(('note:(({Gemfile}))に書かなくても使えるけど古い'))
|
785
|
+
* Can upgrade it by (({gem}))\n
|
786
|
+
(('note:(({gem}))でアップグレードできる'))
|
787
|
+
* e.g.: csv
|
788
|
+
|
789
|
+
= Bundled gem\n(('note:バンドルgem'))
|
790
|
+
|
791
|
+
* Can use it just by (({require}))\n
|
792
|
+
(('note:(({require}))するだけで使える'))
|
793
|
+
* Can't use it without entry in (({Gemfile}))\n
|
794
|
+
(('note:(({Gemfile}))に書かないと使えない'))
|
795
|
+
* Can upgrade it by (({gem}))\n
|
796
|
+
(('note:(({gem}))でアップグレードできる'))
|
797
|
+
* e.g.: test-unit
|
798
|
+
|
799
|
+
= Summary: Library types\n(('note:まとめ:ライブラリーの種類'))
|
800
|
+
|
801
|
+
# RT
|
802
|
+
|
803
|
+
, Plain, Default, Bundled
|
804
|
+
|
805
|
+
(({require})), Yes, Yes, Yes
|
806
|
+
(({Gemfile})), Yes, Yes(*1), No
|
807
|
+
Upgrade, No, Yes, Yes
|
808
|
+
|
809
|
+
(*1) Bundled version is used
|
810
|
+
|
811
|
+
= How to use improved csv?\n(('note:改良されたcsvを使う方法'))
|
812
|
+
|
813
|
+
(({gem install csv}))
|
814
|
+
|
815
|
+
= Faster KEN_ALL.CSV parsing (1)\n(('note:より速いKEN_ALL.CSVのパース(1)'))
|
816
|
+
|
817
|
+
# RT
|
818
|
+
|
819
|
+
, Elapsed
|
820
|
+
|
821
|
+
csv, 0.791s
|
822
|
+
FastestCSV, 0.141s
|
823
|
+
|
824
|
+
= Faster KEN_ALL.CSV parsing (2)\n(('note:より速いKEN_ALL.CSVのパース(2)'))
|
825
|
+
|
826
|
+
# RT
|
827
|
+
|
828
|
+
, Encoding, Elapsed
|
829
|
+
|
830
|
+
csv, CP932, 0.791s
|
831
|
+
FastestCSV, CP932, 0.141s
|
832
|
+
csv, UTF-8, 1.345s
|
833
|
+
FastestCSV, UTF-8, 0.713s
|
834
|
+
|
835
|
+
= Faster KEN_ALL.CSV parsing (3)\n(('note:より速いKEN_ALL.CSVのパース(3)'))
|
836
|
+
|
837
|
+
# RT
|
838
|
+
|
839
|
+
, Encoding, Elapsed
|
840
|
+
|
841
|
+
FastestCSV, UTF-8, 0.713s
|
842
|
+
Python, UTF-8, 0.208s
|
843
|
+
Apache Arrow, UTF-8, 0.145s
|
844
|
+
|
845
|
+
= Further works\n(('note:今後の改善案'))
|
846
|
+
|
847
|
+
* Improve transcoding performance of Ruby\n
|
848
|
+
(('note:Rubyのエンコーディング変換処理の高速化'))
|
849
|
+
* Improve simple case parse performance\n
|
850
|
+
by implementing parser in C\n
|
851
|
+
(('note:シンプルなケース用のパーサーをCで実装して高速化'))
|
852
|
+
* Improve perf. of REXML as well as csv\n
|
853
|
+
(('note:csvのようにREXMLも高速化'))
|
388
854
|
|
389
|
-
=
|
855
|
+
= Join us\n(('note:一緒に開発しようぜ!'))
|
390
856
|
|
391
|
-
*
|
392
|
-
|
857
|
+
* Red Data Tools:\n
|
858
|
+
((<URL:https://red-data-tools.github.io/>))
|
859
|
+
* RubyData Workshop: Today 14:20-15:30
|
860
|
+
* Code Party: Today 19:00-21:00
|
861
|
+
* After Hack: Sun. 10:30-17:30
|
Binary file
|
data/pdf/rubykaigi-2019-csv.pdf
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabbit-slide-kou-rubykaigi-2019
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2019.4.19.
|
4
|
+
version: 2019.4.19.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rabbit
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- config.yaml
|
64
64
|
- csv.rab
|
65
65
|
- images/clear-code-rubykaigi-2019-silver-sponsor.png
|
66
|
+
- images/speee-rubykaigi-2019-cafe-sponsor.png
|
66
67
|
- pdf/rubykaigi-2019-csv.pdf
|
67
68
|
- theme.rb
|
68
69
|
homepage: https://slide.rabbit-shocker.org/authors/kou/rubykaigi-2019/
|