havenwood changed the topic of #ruby to: Ruby 3.4.5, 3.3.9, 3.5.0-preview1 https://www.ruby-lang.org | Log https://libera.irclog.whitequark.org/ruby
wmoxam has quit [Server closed connection]
wmoxam has joined #ruby
sh7d has quit [Ping timeout: 256 seconds]
cappy has quit [Quit: Leaving]
jmcantrell has quit [Ping timeout: 255 seconds]
grenierm has joined #ruby
chair1 has joined #ruby
grenierm has quit [Quit: Client closed]
grenierm has joined #ruby
gr33n7007h has quit [Quit: WeeChat 4.7.0]
gr33n7007h has joined #ruby
pastelowl has quit [Quit: WeeChat 4.7.0]
chair1 has quit [Quit: Client closed]
chair1 has joined #ruby
rapha has quit [Server closed connection]
rapha has joined #ruby
rapha has joined #ruby
chair27 has joined #ruby
chair1 has quit [Ping timeout: 250 seconds]
chair27 is now known as chair1
CRISPR has joined #ruby
chair1 has quit [Quit: Client closed]
CRISPR has quit [Ping timeout: 255 seconds]
Hammdist has quit [Server closed connection]
Hammdist has joined #ruby
ikonia has quit [Ping timeout: 245 seconds]
helveticamono has quit [Server closed connection]
helveticamono has joined #ruby
andy-turner has joined #ruby
gr33n7007h has quit [Ping timeout: 244 seconds]
gr33n7007h has joined #ruby
grenierm has quit [Ping timeout: 250 seconds]
sandra has quit [Remote host closed the connection]
sandra has joined #ruby
infinityfye has joined #ruby
sandra has quit [Remote host closed the connection]
sandra has joined #ruby
infinityfye has quit [Killed (NickServ (GHOST command used by infinityfye__))]
infinityfye__ has joined #ruby
petru has quit [Server closed connection]
petru has joined #ruby
sh7d has joined #ruby
sh7d has quit [Ping timeout: 272 seconds]
<nakilon> I'm running out of RAM; would s = Struct.new(:a, :b); millions.map{ ...; s.new(a, b) } be less time and memory consuming than [a, b] ?
<nakilon> I mean not "running out of RAM" but it gets slow after reaching 4gb, as usual
<nakilon> or nvm, it may be not the bottleneck
<nakilon> replacing this candles[a..b].map{ |_| [bx - _.x, _.y - by] }
<nakilon> with this candles[a..b].map{ |_| bx - _.x }, candles[a..b].map{ |_| _.y - by }
<nakilon> became almost twice faster
yosafbridge has quit [Server closed connection]
yosafbridge has joined #ruby
BSaboia has quit [Quit: ZNC - https://znc.in]
BSaboia has joined #ruby
andy-turner has quit [Ping timeout: 244 seconds]
andy-turner_ has joined #ruby
user71 has joined #ruby
sh7d has joined #ruby
sandra has quit [Remote host closed the connection]
noahmg123 has quit [Server closed connection]
noahmg123 has joined #ruby
infinityfye has joined #ruby
infinityfye__ has quit [Ping timeout: 252 seconds]
sandra has joined #ruby
jmcantrell has joined #ruby
<havenwood> nakilon: While it's not technically reserved, `_` has special meaning in IRB and will overwrite your `_` if you `binding.irb` in so I'd avoid it.
<havenwood> By convention, it also means "unused" to prefix with `_`.
<havenwood> In latest stable, `map { it }` or in whatever supported Ruby `map { _1 }` instead. (Yeah, _1 not following the convention is weird as heck, but it's *mostly* replaced by `it` outside of `_1` with `_2` usage.)
<havenwood> A Struct or Data are indeed smaller than a two element Array. A `require 'objspace'` and `ObjectSpace.memsize_of` is handy for checking.
<havenwood> Twice the iterations, twice as fast. Object churn is expensive at scale.
chair1 has joined #ruby
pavelz has quit [Server closed connection]
pavelz has joined #ruby
FetidToot0 has joined #ruby
FetidToot has quit [Ping timeout: 248 seconds]
FetidToot0 is now known as FetidToot
user71 has quit [Quit: Leaving]
hombrelaser has quit [Server closed connection]
hombrelaser has joined #ruby
TomyLobo has joined #ruby
grenierm has joined #ruby
infinityfye has quit [Read error: Connection reset by peer]
sh7d has quit [Quit: Leaving]
andy-turner_ has quit [Quit: Leaving]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
grenierm has quit [Ping timeout: 250 seconds]
inline has quit [Quit: Leaving]
chair1 has quit [Ping timeout: 250 seconds]
inline has joined #ruby