質問編集履歴
2
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -127,3 +127,19 @@
|
|
127
127
|
- gcc 4.2.1
|
128
128
|
|
129
129
|
- ruby 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
##
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
皆様回答ありがとうございました。
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
BA悩みましたが、検証コードまで書いてくださったraccy様をBAとさせていただきます。
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
改めてありがとうございました。m(_ _)m
|
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -51,3 +51,79 @@
|
|
51
51
|
|
52
52
|
|
53
53
|
なんていうか、くだらない質問ですみません…皆様のご意見を伺いたいです。よろしくお願いします。m(_ _)m
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
## 追記
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
皆さま回答ありがとうございます。m(_ _)m
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
raccy様からいただいた検証コードを試してみましたので、この場を借りて掲載させてください。(2回分です。)
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
```plain
|
70
|
+
|
71
|
+
user system total real
|
72
|
+
|
73
|
+
count_eq 0.000000 0.000000 5.060000 ( 5.073679)
|
74
|
+
|
75
|
+
count_if 0.000000 0.000000 5.040000 ( 5.045016)
|
76
|
+
|
77
|
+
count_if_after 0.000000 0.000000 5.160000 ( 5.170517)
|
78
|
+
|
79
|
+
count_if_null 0.000000 0.000000 5.130000 ( 5.135678)
|
80
|
+
|
81
|
+
count_r_eq 0.000000 0.000000 5.200000 ( 5.206062)
|
82
|
+
|
83
|
+
count_r_if 0.000000 0.010000 5.160000 ( 5.151430)
|
84
|
+
|
85
|
+
count_r_if_after 0.000000 0.000000 5.090000 ( 5.103209)
|
86
|
+
|
87
|
+
count_r_if_null 0.000000 0.000000 5.080000 ( 5.088278)
|
88
|
+
|
89
|
+
result -> line: 10000, total count: 204632007
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
user system total real
|
94
|
+
|
95
|
+
count_eq 0.000000 0.000000 5.140000 ( 5.150710)
|
96
|
+
|
97
|
+
count_if 0.000000 0.000000 5.040000 ( 5.050327)
|
98
|
+
|
99
|
+
count_if_after 0.000000 0.000000 5.100000 ( 5.104275)
|
100
|
+
|
101
|
+
count_if_null 0.000000 0.000000 5.190000 ( 5.203628)
|
102
|
+
|
103
|
+
count_r_eq 0.000000 0.000000 5.110000 ( 5.111663)
|
104
|
+
|
105
|
+
count_r_if 0.000000 0.010000 5.150000 ( 5.137537)
|
106
|
+
|
107
|
+
count_r_if_after 0.000000 0.000000 5.100000 ( 5.118537)
|
108
|
+
|
109
|
+
count_r_if_null 0.000000 0.000000 5.080000 ( 5.077878)
|
110
|
+
|
111
|
+
```
|
112
|
+
|
113
|
+
パッとみた感じでは`if`の方が速く見える部分もあります。
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
環境
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
- MacBook Air (13-inch)
|
122
|
+
|
123
|
+
- Intel Core i5
|
124
|
+
|
125
|
+
- macOS High Sierra (10.13.1)
|
126
|
+
|
127
|
+
- gcc 4.2.1
|
128
|
+
|
129
|
+
- ruby 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]
|