havenwood changed the topic of #ruby to: Ruby 3.3.0, 3.2.3, 3.1.4 https://www.ruby-lang.org | Rules https://ruby-community.com | Logs https://libera.irclog.whitequark.org/ruby
FetidToot has quit [Quit: The Lounge - https://thelounge.chat]
FetidToot has joined #ruby
tarel2 has joined #ruby
konsolebox has joined #ruby
CrazyEddy has joined #ruby
konsolebox_ has joined #ruby
konsolebox has quit [Ping timeout: 245 seconds]
weaksauce has quit [Quit: Textual IRC Client: www.textualapp.com]
weaksauce has joined #ruby
donofrio_ has joined #ruby
donofrio__ has quit [Ping timeout: 256 seconds]
karolis_ has quit [Ping timeout: 252 seconds]
CrazyEddy has left #ruby [#ruby]
CrazyEddy has joined #ruby
konsolebox_ has quit [Ping timeout: 245 seconds]
konsolebox has joined #ruby
Vonter has joined #ruby
Linux_Kerio has joined #ruby
bovis has quit [Quit: leaving]
c10l has quit [Ping timeout: 252 seconds]
CrazyEddy has left #ruby [#ruby]
CrazyEddy has joined #ruby
c10l has joined #ruby
gaussianblue has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
grenierm has joined #ruby
Aminda has quit [Remote host closed the connection]
Aminda has joined #ruby
_ht has joined #ruby
crespire has quit [Killed (NickServ (GHOST command used by crespire1))]
crespire1 has joined #ruby
Aminda has quit [Remote host closed the connection]
Aminda has joined #ruby
Linux_Kerio has quit [Ping timeout: 246 seconds]
Trivial has joined #ruby
TomyWork has joined #ruby
grenierm has quit [Ping timeout: 250 seconds]
Al2O3 has quit [Ping timeout: 256 seconds]
jmjl- is now known as jmjl
dalan03822833508 has joined #ruby
hightower2 has quit [Ping timeout: 255 seconds]
u0_a115 has joined #ruby
u0_a1151 has joined #ruby
karolis_ has joined #ruby
u0_a115 has quit [Ping timeout: 272 seconds]
karolis_ has quit [Remote host closed the connection]
dalan03822833508 has quit [Read error: Connection reset by peer]
dalan03822833508 has joined #ruby
u0_a1151 has quit [Ping timeout: 240 seconds]
gaussianblue has quit [Quit: leaving]
Linux_Kerio has joined #ruby
Linux_Kerio has quit [Read error: Connection reset by peer]
Starfoxxes has quit [Ping timeout: 268 seconds]
Al2O3 has joined #ruby
Starfoxxes has joined #ruby
xkoncek has quit [Ping timeout: 255 seconds]
passbe has quit [Quit: bye...]
passbe has joined #ruby
<sam113101> guys explain something to me
<sam113101> why is num.prime? much faster than Prime.prime?(num)
<sam113101> I think I already asked this but I don't remember
<konsolebox> The latter sensibly has more internal calls in it. But other than that it's gotta be the implementation. Prime (https://github.com/ruby/prime) is not written in C.
xdminsy has quit [Quit: Konversation terminated!]
xdminsy has joined #ruby
___nick___ has joined #ruby
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
gaussianblue has joined #ruby
___nick___ has joined #ruby
Trivial has quit [Ping timeout: 272 seconds]
<sam113101> konsolebox: They're both from that lib and they're both written in ruby. num.prime? comes from the lib injecting into Integer, it's not a default ruby function. But indeed they have a different implementation, and I'm starting to understand why one is faster than the other. I still wonder, why even have the slower one at all? Why not just make them both the same.
<weaksauce> sam113101 havenwood has some thoughts on that
<weaksauce> anyway it boils down to the prime library is a toy implementation
<weaksauce> not sure why the first one is faster
<konsolebox> It also needs context. Faster in the call itself alone or multiple calls?
mark22k has quit [Quit: The Lounge - https://thelounge.chat]
mark22k has joined #ruby
gaussianblue has quit [Quit: leaving]
xdminsy has quit [Read error: Connection reset by peer]
Al2O3 is now known as Hoppy420
<sam113101> first one is faster because it does a Miller Rabin test with a limited set of bases, whereas the other one basically does a simple division test with numbers that are not divisible by 2 and 3
<sam113101> and from what I understand it's also checking numbers greater than the square root
<weaksauce> sam113101 where is num.prime? coming for
<weaksauce> from*
<weaksauce> it's not in integer or numeric from what i can tell
<sam113101> weaksauce: it gets injected in class Integer when you require 'prime': https://github.com/ruby/prime/blob/master/lib/prime.rb#L35
<weaksauce> ok that's even weirder then
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
havenwood has quit [Quit: The Lounge - https://thelounge.chat]
havenwood has joined #ruby
konsolebox has quit [Quit: .]
___nick___ has quit [Ping timeout: 256 seconds]
_ht has quit [Remote host closed the connection]
xkoncek has joined #ruby
xkoncek has quit [Remote host closed the connection]
xkoncek has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
pascal_blaze has joined #ruby
pascal_blaze has quit [Ping timeout: 245 seconds]
<[0x1eef]> Is the Ruby discord more active than here ?
<weaksauce> yeah
<weaksauce> quite a bit more
<[0x1eef]> Makes sense. This might be the quietest channel I'm in. Besides #TempleOS XD
sagax has quit [Quit: Konversation terminated!]
<gr33n7007h> it appeared to slowly decline after the freenode/libera transition
polishdub has quit [Ping timeout: 260 seconds]