non-aristotelian has quit [Quit: non-aristotelian]
_whitelogger has joined #crystal-lang
r3m is now known as C-o
yasserhussain111 has joined #crystal-lang
<yasserhussain111>
hello
yasserhussain111 has left #crystal-lang [#crystal-lang]
yasserhussain111 has joined #crystal-lang
yasserhussain111 has left #crystal-lang [#crystal-lang]
yasserhussain111 has joined #crystal-lang
ua has quit [Ping timeout: 246 seconds]
ua has joined #crystal-lang
yasserhussain111 has left #crystal-lang [#crystal-lang]
ashirase has quit [Ping timeout: 250 seconds]
ashirase has joined #crystal-lang
DTZUZO has joined #crystal-lang
DTZUZO has quit [Quit: WeeChat 2.0]
DTZUZO has joined #crystal-lang
ddffg has joined #crystal-lang
ddffg has quit [Remote host closed the connection]
return0e has quit [Ping timeout: 240 seconds]
azuri5 has joined #crystal-lang
azuri5 has quit [Quit: azuri5]
return0e has joined #crystal-lang
ua has quit [Ping timeout: 244 seconds]
rohitpaulk has joined #crystal-lang
ua has joined #crystal-lang
Raimondi has joined #crystal-lang
DTZUZO has quit [Ping timeout: 246 seconds]
rohitpaulk has quit [Ping timeout: 245 seconds]
Raimondi has quit [Ping timeout: 240 seconds]
Renich has joined #crystal-lang
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
<yxhuvud>
Hmm. Shouldn't Enumerable.html#each_cons use a Deque instead of an array internally?
<oprypin>
yxhuvud, the `count` in each_cons is almost always tiny, so it would make no difference. but it should certainly be allowed to pass a `Deque` for `reuse`.
<oprypin>
i'd change it to `if reuse.is_a?(Bool)`
<oprypin>
or actually, this could be two different methods
<yxhuvud>
oprypin: with 25_000_000 elements, the difference is big even with only 2 elements.
<oprypin>
it will probably be slower with deque in that case, lol
<oprypin>
try and see
<yxhuvud>
I did, and deque seems twice as fast at that size, for small inputs and has constant speed on bigger counts, while the array implementation balloons. I guess I'll do some more organized benchmarking tomorrow.
<yxhuvud>
*inputs -> counts. input stay constant at 21M
<oprypin>
yxhuvud, is `a, b = pair` part of your test?
<oprypin>
cuz i cant believe that it's actually faster
<yxhuvud>
well, I compare it against a needle I'm looking for and it prints out the index for when it finds it. the index is 20288091, FWIW.