havenwood changed the topic of #ruby to: Ruby 3.4.2, 3.3.7 https://www.ruby-lang.org | Log https://libera.irclog.whitequark.org/ruby
Rounin has quit [Ping timeout: 248 seconds]
jasfloss has quit [Ping timeout: 245 seconds]
cappy has quit [Quit: Leaving]
TomyWork has quit [Quit: Leaving]
MsInput has quit [Quit: WeeChat 4.6.0]
lutherann has quit [Quit: WeeChat 4.4.3]
lutherann has joined #ruby
brokkoli_origin has quit [Ping timeout: 244 seconds]
brokkoli_origin has joined #ruby
STASIdownunder has joined #ruby
STASIdownunder has quit [Client Quit]
STASIdownunder has joined #ruby
Linux_Kerio has joined #ruby
STASIdownunder has quit [Quit: WeeChat 4.5.1]
STASIdownunder has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
ih8u has joined #ruby
Pixi` is now known as Pixi
patrick has quit [Ping timeout: 276 seconds]
patrick_ is now known as patrick
STASIdownunder has quit [Ping timeout: 268 seconds]
patrick_ has joined #ruby
patrick has joined #ruby
patrick has quit [Changing host]
patrick_ is now known as patrick
patrick_ has joined #ruby
naiithink has joined #ruby
naiithink has quit [Client Quit]
naiithink has joined #ruby
naiithink has quit [Client Quit]
grenierm has joined #ruby
jmcantrell has quit [Quit: WeeChat 4.6.0]
jmcantrell_ is now known as jmcantrell
Linux_Kerio has quit [Ping timeout: 245 seconds]
STASIdownunder has joined #ruby
STASIdownunder has quit [Read error: Connection reset by peer]
blacknova has joined #ruby
___nick___ has joined #ruby
STASIdownunder has joined #ruby
STASIdownunder has quit [Read error: Connection reset by peer]
Rounin has joined #ruby
hwpplayer1 has joined #ruby
gr33n7007h has quit [Ping timeout: 252 seconds]
gr33n7007h has joined #ruby
andy-turner has joined #ruby
blacknova has quit [Quit: Connection closed for inactivity]
hwpplayer1 has quit [Remote host closed the connection]
mrj has quit [Remote host closed the connection]
mjones has joined #ruby
wbooze has quit [Ping timeout: 252 seconds]
wbooze has joined #ruby
vlad87 has joined #ruby
<vlad87> Hi everyone,
<vlad87> I have a curiosity regarding a simple ruby program stolen from this talk https://youtu.be/ZE6F3drGhA8?t=1811
<vlad87> <<EOF
<vlad87> def allocations
<vlad87>   x = GC.stat(:total_allocated_objects)
<vlad87>   yield
<vlad87>   GC.stat(:total_allocated_objects) - x
<vlad87> end
<vlad87> p allocations { 1 }
<vlad87> p allocations { 1 }
<vlad87> EOF
<vlad87> Running this program with ruby version 2.7.8 works as I imagined - both calls should print "0" to stdout (considering no allocations are happening in the provided block). However, running it with any ruby version starting from 3.0.7 (may not be the exact one introducing the behavior just what i tested with) I get strange results: first call to
<vlad87> allocations outputs 1 and then any other future call to it outputs 0 as I initially expected. I get even stranger results with something like:
<vlad87> <<EOF
<vlad87> class A end
<vlad87> p allocations { A.new }
<vlad87> p allocations { A.new }
<vlad87> EOF
STASIdownunder has joined #ruby
vlad87 has quit [Client Quit]
STASIdownunder has quit [Read error: Connection reset by peer]
<wbooze> allocates only once ?
Linux_Kerio has joined #ruby
STASIdownunder has joined #ruby
<o0x1eef> A.new allocates 4 then 2, that's surprising to me, but I'm not sure you can exclude overhead in those calculations, as in, there might be allocations going on behind the scenes that aren't apparent but contribute to the count.
STASIdownunder has quit [Read error: Connection reset by peer]
<o0x1eef> So I'd probably treat it similar to a yard stick rather than an exact measurement
GreenResponse has joined #ruby
Guest98 has joined #ruby
Guest98 has quit [Client Quit]
andy-turner has quit [Quit: Leaving]
andy-turner has joined #ruby
user71 has joined #ruby
STASIdownunder has joined #ruby
lutherann has quit [Ping timeout: 260 seconds]
STASIdownunder has quit [Read error: Connection reset by peer]
lutherann has joined #ruby
lutherann has quit [Client Quit]
STASIdownunder has joined #ruby
STASIdownunder has quit [Quit: STASI exists down under]
STASIdownunder has joined #ruby
__jmcantrell__ has joined #ruby
___nick___ has quit [Ping timeout: 268 seconds]
___nick___ has joined #ruby
factor has joined #ruby
factor has quit [Client Quit]
factor has joined #ruby
aesthetikx has quit [Ping timeout: 260 seconds]
grenierm has quit [Quit: Client closed]
aesthetikx has joined #ruby
Rounin has quit [Ping timeout: 276 seconds]
factor has quit [Quit: The Lounge - https://thelounge.chat]
fantazo has joined #ruby
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
CRISPR has joined #ruby
___nick___ has joined #ruby
Rounin has joined #ruby
Rounin has quit [Changing host]
Rounin has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
cappy has joined #ruby
CRISPR has quit [Ping timeout: 272 seconds]
CRISPR has joined #ruby
rvalue- has joined #ruby
rvalue has quit [Ping timeout: 252 seconds]
rvalue- is now known as rvalue
<havenwood> o0x1eef: I'd say it was object shapes, but that's 3.2. Probably method inlining optimizations or other pre-shape freeze stuff.
CRISPR has quit [Ping timeout: 246 seconds]
<o0x1eef> Makes sense, and nice to see Chris's work continue to have an impact
Vonter has quit [Ping timeout: 260 seconds]
Vonter has joined #ruby
user71 has quit [Quit: Leaving]
CRISPR has joined #ruby
Linux_Kerio has quit [Ping timeout: 252 seconds]
CRISPR has quit [Read error: Connection reset by peer]
GreenResponse has quit [Quit: Leaving]
fantazo has quit [Quit: leaving]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
andy-turner has quit [Quit: Leaving]
jmcantrell is now known as Guest4344
Guest4344 has quit [Killed (molybdenum.libera.chat (Nickname regained by services))]
__jmcantrell__ is now known as jmcantrell
jmcantrell_ has joined #ruby
cappy has quit [Quit: Leaving]
sarna has quit [Ping timeout: 252 seconds]
sarna has joined #ruby
STASIdownunder has quit [Quit: Leaving]
STASIdownunder has joined #ruby
STASIdownunder has quit [Remote host closed the connection]
STASIdownunder has joined #ruby