RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.27.0 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
Raimondi has quit [Ping timeout: 240 seconds]
Renich has joined #crystal-lang
RX14 has quit [Remote host closed the connection]
RX14 has joined #crystal-lang
Renich has quit [Quit: Renich]
Renich has joined #crystal-lang
Renich has quit [Quit: Renich]
Giove has joined #crystal-lang
Giove has quit [Quit: Page closed]
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.
<oprypin> please paste the code
<oprypin> im just genuinely curious
<yxhuvud> https://gist.github.com/yxhuvud/38f437fd8e7dfdd2b5811674a1b3978c <- comment at the end as necessary (contains AoC spoilers)
<oprypin> yxhuvud, just send a pull request to make it accept not only Array for `reuse`. but i think changing the default will be very controversial
<yxhuvud> can you repeat it?
non-aristotelian has joined #crystal-lang
<oprypin> you can just re-read it O_o what do you mean?
<yxhuvud> the results I had, not your sentence :P
<oprypin> oh.. well i looked at the program and i was just disappointed it's not a Benchmark
<yxhuvud> Well, it was the code I had available. time is not very precise, but can still be repeatable enough to show a difference.
coderobe has quit [Quit: '); DROP TABLE users;--]
coderobe has joined #crystal-lang
coderobe has quit [Client Quit]
ua has quit [Ping timeout: 268 seconds]
baweaver is now known as lemur
lemur is now known as baweaver
coderobe has joined #crystal-lang
Renich has quit [Ping timeout: 250 seconds]
Renich has joined #crystal-lang
ua has joined #crystal-lang
Renich has quit [Quit: Renich]
Renich has joined #crystal-lang
Renich has quit [Remote host closed the connection]
Renich has joined #crystal-lang
Renich has quit [Client Quit]
Raimondi has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
Raimondii has quit [Ping timeout: 240 seconds]
nchambers has joined #crystal-lang
nchambers has left #crystal-lang ["WeeChat 2.2"]
Raimondii has joined #crystal-lang
Raimondii is now known as Raimondi
Raimondi has quit [Ping timeout: 240 seconds]