<oz>
enabling yjit will, by default, allocate 256M. It's a lot for micro-benchmarks, but I guess it works for larger Rails apps.
<libsys>
buy... python is pretty high language also
<libsys>
xd sorry
<libsys>
but.. python is a pretty high level lang also
polishdub has quit [Quit: leaving]
AndreYuhai has joined #ruby
<ox1eef>
what's great about truffleruby, looks like yet another implementation based on the jvm - so with that, comes all the limitations i've been use to with jruby.
<ox1eef>
cruby or die, that's how it is.
gproto23 has quit [Remote host closed the connection]
<adam12>
Heh
<oz>
mri/cruby's only getting better it seems. It's already nice and fast for a lot of [my] use cases.
<oz>
nothing wrong with using something lower-level when you need more perf. though ¯\_(ツ)_/¯
oxfuxxx has joined #ruby
AndreYuhai has quit [Quit: Lost terminal]
oxfuxxx has quit [Ping timeout: 272 seconds]
<havenwood>
libsys: I prefer letting each language write it the way that's right. Otherwise you just get bias towards languages that prefer a style more similar to C.
<havenwood>
libsys: Here's a benchmark, for example, that's almost as low level but dips higher into practical things too. https://github.com/kostya/benchmarks
<havenwood>
libsys: Ruby does tend to target low memory when a JIT isn't selected, but Python has also has a ton of optimizations.
<havenwood>
As far as interpreted languages go, I'd consider Ruby in the low memory category generally. It certainly varies.
<havenwood>
Jemalloc or malloc trim help.
<havenwood>
Ruby doesn't enable these by default but they're ubiquitous in production.
<havenwood>
These benchmarks look at memory but don't use standard memory saving options.
szkl has joined #ruby
seabre has quit [Remote host closed the connection]
<adam12>
Speaking of memory use, I'd love some official mechanisms to inspect the heap / perhaps trigger GC / whatever.
<adam12>
ruby -p $SOME_PROCESS_PID -e 'GC.start` or something.
<adam12>
Pretty sure I can do this through rbtrace but its _just another_ dependency, and Aman (rbtrace maintainer) seems like they are doing less ruby these days.
<adam12>
Actually I think you can do this through gdb too.
bit4bit has quit [Quit: Leaving]
<ox1eef>
oz: those negative attitudes towards cruby's performance mostly come from a decade ago, back when 1.8.6/7 was hot, and the boot time for jruby/jvm is brutal. i'd say its for niche cases at best.
<ox1eef>
it doesn't help that the maintainer of truffleruby is a british soldier, and into monoarchy and all that nonsense. that turns me away as well, ill be honest.
titibandit has quit [Remote host closed the connection]
howdoi has joined #ruby
John_Ivan has quit [Ping timeout: 244 seconds]
gr33n7007h has joined #ruby
seabre has joined #ruby
jpn_ has quit [Ping timeout: 256 seconds]
hellstabber has joined #ruby
hellstabber has quit [Client Quit]
hellstabber has joined #ruby
dionysus69 has quit [Ping timeout: 244 seconds]
jpn has joined #ruby
r3m has quit [Quit: WeeChat 3.6-dev]
r3m has joined #ruby
jpn_ has joined #ruby
jpn has quit [Ping timeout: 272 seconds]
jpn_ has quit [Ping timeout: 260 seconds]
jpn has joined #ruby
_ht has joined #ruby
jpn has quit [Ping timeout: 240 seconds]
jpn has joined #ruby
protektwar has quit [Ping timeout: 244 seconds]
jpn has quit [Ping timeout: 240 seconds]
jpn has joined #ruby
<ox1eef>
adam12: you know about the methods on GC, too? they can provide some insight into that.
<adam12>
ox1eef: Yeah. I think some mechanism to query a remote process would be nice.
<adam12>
s/remote/running
jpn has quit [Ping timeout: 276 seconds]
konsolebox has joined #ruby
gproto23 has joined #ruby
shokohsc has quit [Ping timeout: 240 seconds]
<ox1eef>
agreed, i seem to remember some attempts at that.
TomyWork has quit [Remote host closed the connection]
henk has joined #ruby
<henk>
hi, I have some ruby code for puppet, see http://pastie.org/p/2fuA9G0asO4mGfb2bSR6yl. I don’t quite understand when and why it uses 'class << self' for some method/function definitions, 'def self.foo' for others, and just 'def bar' for most. I read that 'class << self' is for defining 'singleton methods' but I’m not sure I really understand the concept. Also I wonder if it’s the same as 'def self.foo' and
<henk>
if not, what’s the difference? I’m mostly a noob when it comes to programming, so if anyone could point me to some resource explaining the necessary fundamentals to me like I’m 5 years old, I’d appreciate that.
<adam12>
henk: In your example, class << self and def self.method_name are equivalent.
<henk>
adam12: ah, good, thank you
<adam12>
henk: The reason they switched between them is probably two fold: 1. someone likely wasn't paying attention, and 2. the class << self uses an attr_accessor, which is not available by just calling self. You need to reopen the eigenclass (the singleton class if you want to think of it that way)
<henk>
adam12: I only guessed the former :D thanks
finsternis has joined #ruby
konsolebox has quit [Remote host closed the connection]
Acdlbs has joined #ruby
___nick___ has quit [Ping timeout: 276 seconds]
<Acdlbs>
anyone doing modern rails devlopment using emacs? & if so what packages are you using?
pfharlock has quit [Remote host closed the connection]
pfharlock has joined #ruby
gproto23 has quit [Remote host closed the connection]
<henk>
adam12: can you, by any chance, also take a guess why these functions are put in the eigenclass? I think I still don’t understand the concept of the eigenclass well enough to understand this … or how puppet interacts with this code. I’m trying to figure out which it is (:
CrazyEddy has quit [Ping timeout: 252 seconds]
cocalero has joined #ruby
stylo has joined #ruby
John_Ivan has joined #ruby
pfharlock has quit [Remote host closed the connection]
pfharlock has joined #ruby
<libsys>
acosta: I use solargraph with lsp-mode
<libsys>
ahm... sorry acosta ... wanted to answer Acdlbs, but he's gone
ur5us has joined #ruby
typeof[panda] has joined #ruby
pfharlock has quit [Remote host closed the connection]
pfharlock has joined #ruby
pfharlock has quit [Remote host closed the connection]
pfharlock has joined #ruby
szkl has joined #ruby
robotmay has quit [Quit: No Ping reply in 180 seconds.]
robotmay has joined #ruby
<adam12>
henk: It's not obvious why. But the eigenclass is basically a hidden object of the class you're looking at. There's better explanations out in the world, but you could think of them as class methods.
<adam12>
henk: It's actually unfortunate that they don't use the class builder pattern, but that's beside the point.
<adam12>
henk: If we replaced the top line with something like `class S6Service`, then re-opening the eigenclass (or calling def self.some_method in the class body) would be adding methods to the class (or instance methods to the eigenclass). So class S6Service; class << self; def foo; end; end would be called with S6Service.foo (the foo method on the class
<adam12>
S6Service).
<adam12>
henk: Unfortunately there's no great way to determine why they've done anything, but maybe it's a contract for classes to meet a certain API that Puppet expects?
pfharlock has quit [Remote host closed the connection]