razetime has quit [Remote host closed the connection]
c10l733 is now known as c10l
Sankalp has quit [Ping timeout: 264 seconds]
nirvdrum has joined #ruby
Sankalp has joined #ruby
nirvdrum_ has joined #ruby
nirvdrum has quit [Read error: Connection reset by peer]
nirvdrum_ has quit [Client Quit]
weaksauc_ has joined #ruby
JayDoubleu__ has quit [Ping timeout: 250 seconds]
itok has quit [Ping timeout: 250 seconds]
weaksauce has quit [Ping timeout: 250 seconds]
desnudopenguino1 has joined #ruby
JayDoubleu__ has joined #ruby
itok has joined #ruby
vito_ has quit [Ping timeout: 250 seconds]
desnudopenguino has quit [Ping timeout: 250 seconds]
desnudopenguino1 is now known as desnudopenguino
FullMetalStacker has joined #ruby
vito_ has joined #ruby
<FullMetalStacker>
#benching #performance: I see you guys from time to time benching the performance of various approaches and compare them so to know which code is better. Currently I want to compare the performance of:
<FullMetalStacker>
str.each_char.tally.to_a and
<FullMetalStacker>
str.chars.tally.to_a. Can someone give me a hint on how I can do that benching on my own?
<FullMetalStacker>
alright, will check out both, thank you very much!
<FullMetalStacker>
what do you mean with "better metric"?
<FullMetalStacker>
ah ok i got it.
<adam12>
FullMetalStacker: I generally don't care how long something is taking, more so I want to know how many times per second something can be done.
<adam12>
Not sure if that helps.
<FullMetalStacker>
iterations per second is a better metric than measuring time
<adam12>
Yeah, at least IMHO.
<FullMetalStacker>
got it
maroloccio has joined #ruby
Linux_Kerio has quit [Read error: Connection reset by peer]
<apteryx>
actual problem I'm facing: I have this on my GEM_PATH: /gnu/store/lfplkhhibjmj6w4hf079vfn741xnzdmp-ruby-railties-7.0.4.2/lib/ruby/vendor_ruby; the Rake file is at /gnu/store/i5d1x7b6k1xg33fs2wg37grwy8sgsziz-ruby-railties-7.0.4.2/lib/ruby/vendor_ruby/gems/railties-7.0.4.2/lib/rails/tasks/engine.rake, but 'load "rails/tasks/engine.rake"' in the Rakefile doesn't find it
<apteryx>
it says: LoadError: cannot load such file -- rails/tasks/engine.rake
wk_ has joined #ruby
<ox1eef_>
apteryx: You have 'Rake.application' in Rakefile.rb, and it has methods like 'add_import', and another method that loads those automatically (using Kernel#load). That's where I would start exploring. In Rakefile.rb, add 'binding.irb' and take a look around.
defectiverobot has joined #ruby
<apteryx>
thanks
dviola has quit [Ping timeout: 276 seconds]
yossarian has quit [Quit: And then he took off.]
yossarian has joined #ruby
yossarian has quit [Changing host]
yossarian has joined #ruby
nirvdrum has joined #ruby
defectiverobot has quit [Remote host closed the connection]
defectiverobot has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
defectiverobot has quit [Ping timeout: 252 seconds]
dviola has joined #ruby
defectiverobot has joined #ruby
defectiverobot_ has joined #ruby
defectiverobot has quit [Read error: Connection reset by peer]
dionysus69 has quit [Ping timeout: 250 seconds]
TomyWork has quit [Remote host closed the connection]
dionysus69 has joined #ruby
ye13 has joined #ruby
defectiverobot_ has quit [Ping timeout: 252 seconds]
razetime1 has joined #ruby
razetime has quit [Ping timeout: 276 seconds]
enarth86 has joined #ruby
razetime1 is now known as razetime
<ox1eef_>
Welcome.
ye13 has quit [Ping timeout: 252 seconds]
NightMonkey_ has joined #ruby
NightMonkey has quit [Ping timeout: 246 seconds]
NightMonkey_ is now known as NightMonkey
defectiverobot has joined #ruby
dionysus69 has quit [Ping timeout: 265 seconds]
defectiverobot has quit [Remote host closed the connection]
razetime has quit [Remote host closed the connection]
defectiverobot has joined #ruby
szkl has quit [Quit: Connection closed for inactivity]
defectiverobot has quit [Ping timeout: 255 seconds]
ultralan has joined #ruby
ultralan has quit [Remote host closed the connection]
defectiverobot has joined #ruby
defectiverobot has quit [Remote host closed the connection]
mexen has joined #ruby
MalusVulgaris has quit [Quit: MalusVulgaris]
nirvdrum has joined #ruby
hansolo has quit [Read error: Connection reset by peer]
apteryx has quit [Ping timeout: 248 seconds]
hansolo has joined #ruby
seborr72 has joined #ruby
seborr72 has quit [Remote host closed the connection]
uncoun46 has joined #ruby
enarth86 has quit [Ping timeout: 256 seconds]
uncoun46 has quit [Remote host closed the connection]
condui39 has joined #ruby
apteryx has joined #ruby
dionysus69 has joined #ruby
<havenwood>
FullMetalStacker: +1 Benchmark.ips, it's nice. Also be sure to check YJIT impact since sometimes it inverts the results.
<havenwood>
FullMetalStacker: The other thing you might look at is memory usage.
<havenwood>
Unsure if you're using UTF-8 and this applies to you, but often folk should consider `grapheme_clusters` instead of `chars`.
<FullMetalStacker>
hi @havenwood: thanks! how do i bench the RAM?
<havenwood>
Or `each_grapheme_cluster` in place of `each_char`.
<havenwood>
FullMetalStacker: There are a variety of options for memory, but it's not as straightforward as checking iterations per second.
<FullMetalStacker>
CMDBEnch is a general purpose benchmarking tool? So do i understand it correctly that there is no option to measure that within ruby alone, but have to use system tools for the entire system_
<FullMetalStacker>
?
nirvdrum has joined #ruby
<havenwood>
An aside, but protip if you're making Ruby command line apps without use of RubyGems, it's way faster to disable gems.
desnudopenguino has quit [Ping timeout: 246 seconds]
desnudopenguino1 is now known as desnudopenguino
<ox1eef_>
Very cool xD
nirvdrum has joined #ruby
<adam12>
Would you consider the shorthand "magic"?
<adam12>
I'm always trying to reduce mental load and be more explicit, especially on teams where there may be juniors, and the shorthand would probably be non grata on my projects.
<ox1eef_>
I'm familiar with it because of JavaScript, but AFAIK JavaScript keeps it to locals that are in scope. function foo() {}, and foo = function() {} both evaluate to {foo: function() {}} when used with {foo}.
<ox1eef_>
And I agree, it is bit of a mind bender at first.