adam12 changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.0.2, 2.7.4, 2.6.8: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
cahoots has quit [Ping timeout: 252 seconds]
ua_ has quit [Ping timeout: 265 seconds]
ua_ has joined #ruby
cahoots has joined #ruby
<nakilon> so finally it looks like this https://dpaste.org/ER8i/slim I now just expand the ranges and regexes
ur5us has quit [Ping timeout: 240 seconds]
cahoots has quit [Ping timeout: 240 seconds]
<nakilon> the only issue is that it's harder to user line-profiler to find the bottlenecking matcher in this Hash, but no one uses line-profilers in Ruby anyway
<nakilon> *to use
seisatsu has quit [Ping timeout: 255 seconds]
seisatsu has joined #ruby
<weaksauce> yeah that's a lot better than the dry-json thing
cahoots has joined #ruby
crankharder has quit [Ping timeout: 252 seconds]
<nakilon> is it considered ok to have \n in exception messages?
ua_ has quit [Ping timeout: 268 seconds]
ua_ has joined #ruby
ua_ has quit [Ping timeout: 245 seconds]
ua_ has joined #ruby
crankharder has joined #ruby
ur5us has joined #ruby
crankharder has quit [Ping timeout: 258 seconds]
<nakilon> you said it's brittle ..D
<nakilon> I'll gemify it later after I reuse it once or twice somewhere else
ua_ has quit [Ping timeout: 252 seconds]
crankharder has joined #ruby
ua_ has joined #ruby
crankharder has quit [Ping timeout: 252 seconds]
crankharder has joined #ruby
crankharder has quit [Quit: leaving]
Guest6182 has joined #ruby
Guest6182 has quit [Quit: Client closed]
ua_ has quit [Ping timeout: 276 seconds]
ua_ has joined #ruby
gggp has joined #ruby
ua_ has quit [Ping timeout: 268 seconds]
ua_ has joined #ruby
perrierjouet has joined #ruby
<rg> as long as its readable a new line is fine by me.
willow has quit [Quit: willow]
gggp has quit [Remote host closed the connection]
gggp has joined #ruby
gggp_ has joined #ruby
gggp has quit [Ping timeout: 272 seconds]
ur5us has quit [Ping timeout: 245 seconds]
dyCrazyEd has joined #ruby
drincruz_ has quit [Ping timeout: 240 seconds]
Melantha has quit [Ping timeout: 256 seconds]
drincruz_ has joined #ruby
perrierjouet has quit [Quit: WeeChat 3.2]
gggp__ has joined #ruby
gggp_ has quit [Ping timeout: 240 seconds]
gggp has joined #ruby
gggp__ has quit [Ping timeout: 265 seconds]
gggp_ has joined #ruby
gggp has quit [Ping timeout: 250 seconds]
perrierjouet has joined #ruby
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
Nowaker has quit [Remote host closed the connection]
perrierj1 has joined #ruby
perrierj1 has quit [Client Quit]
Nowaker has joined #ruby
perrierj1 has joined #ruby
perrierj1 has quit [Client Quit]
Nik- has joined #ruby
Nik- has quit [Client Quit]
easbarbosa has quit [Ping timeout: 276 seconds]
teclator has joined #ruby
jetchisel has joined #ruby
mrkz_c has quit [Quit: Connection closed for inactivity]
perrierj1 has joined #ruby
perrierj1 has quit [Remote host closed the connection]
perrierj1 has joined #ruby
perrierj1 has quit [Client Quit]
perrierjouet has quit [Quit: WeeChat 3.0]
perrierjouet has joined #ruby
perrierjouet has quit [Client Quit]
gggp__ has joined #ruby
gggp_ has quit [Ping timeout: 240 seconds]
jmcgnh has quit [Ping timeout: 258 seconds]
jmcgnh has joined #ruby
gggp__ is now known as gggp
reset has quit [Quit: reset]
hexreel has joined #ruby
royo25 has joined #ruby
hexreel has quit [Quit: nyaa~]
fossdd has quit [Ping timeout: 252 seconds]
fossdd has joined #ruby
jetchisel has quit [Ping timeout: 245 seconds]
jetchisel has joined #ruby
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
gggp_ has joined #ruby
gggp has quit [Ping timeout: 240 seconds]
gggp__ has joined #ruby
Melantha has joined #ruby
gggp_ has quit [Ping timeout: 240 seconds]
fossdd has quit [Ping timeout: 265 seconds]
fossdd has joined #ruby
gggp_ has joined #ruby
gggp__ has quit [Ping timeout: 272 seconds]
aeri- has joined #ruby
aeris has quit [Ping timeout: 244 seconds]
gggp__ has joined #ruby
gggp_ has quit [Ping timeout: 258 seconds]
fossdd has quit [Ping timeout: 256 seconds]
fossdd has joined #ruby
fossdd has quit [Ping timeout: 250 seconds]
fossdd has joined #ruby
motherr has joined #ruby
fossdd has quit [Ping timeout: 268 seconds]
fossdd has joined #ruby
goepsilongo has joined #ruby
dviola has quit [Ping timeout: 265 seconds]
dviola has joined #ruby
aeris has joined #ruby
aeri- has quit [Ping timeout: 244 seconds]
Bounga has joined #ruby
sleetdrop has joined #ruby
fossdd has quit [Remote host closed the connection]
fossdd has joined #ruby
FetidToot7 has joined #ruby
FetidToot has quit [Ping timeout: 252 seconds]
FetidToot7 is now known as FetidToot
fossdd has quit [Ping timeout: 252 seconds]
fossdd has joined #ruby
qunzhong_luxian has joined #ruby
sleetdrop has quit [Quit: Textual IRC Client: www.textualapp.com]
gggp__ has quit [Read error: Connection reset by peer]
jetchisel has joined #ruby
seydar has joined #ruby
<seydar> I've got a CPU-bound process that I'm trying to use multithreading to tackle (on a 4-core laptop). Right now, it's using Ruby threads, which I *think* correlate to native threads and are not bound by a GIL. I am likely wrong, because it is not giving me the speedup I desire. How would you recommend I improve upon this to get *actual* parallel processing? https://pastebin.com/J7xyaSN4
<ruby[bot]> seydar: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
<adam12> seydar: Have you looked at the parallel gem?
<adam12> seydar: Your only option is likely multiple processes, which will avoid the GIL.
<seydar> adam12: I have, but it uses a queuing system for multithreading: 1st elt to one thread, 2nd elt to another thread, etc. I was afraid that that was providing too much overhead which was why I wasn't getting any speedup, so I tried splitting it by chunks (first quarter of the array to one thread, second quarter to another, etc.)
<seydar> adam12: If I'm using fork to do my multithreading, what's the best way to get a result back?
<adam12> seydar: Maybe IO.pipe? or some other IPC mechanism.
<seydar> adam12: and after digging into the code for parallel, it still seems to use Thread.new, even for multiple processes
<adam12> seydar: It should use fork if you pass it a processes option.
fossdd has quit [Remote host closed the connection]
<nakilon> is there any search service for homebrew? not just regex matching the formula name bug something more clever, like matching description or machine-learning or community-organized topics like tags in ruby toolbox
fossdd has joined #ruby
<seydar> adam12: Welp, I'm terrible at reading code. I should've known my conclusion was fishy. It definitely uses fork and it definitely uses pipes to send data from a child to the parent.
<seydar> Please scrub my question from the logs
<nakilon> seydar's snippet above seems good enough but
<nakilon> you do the Integer#/
fossdd has quit [Remote host closed the connection]
<seydar> nakilon: yeah, that'd deliberate because I can't slice an array with a Float
<nakilon> so you'll lose last mod(4) elements, lol
<seydar> nakilon: Enumerable#each_slice returns you the last mod(4) elements at the end
<nakilon> oh, true, you'll just get the very tiny 5th thread
dviola has quit [Changing host]
dviola has joined #ruby
seydar has quit [Quit: leaving]
seydar has joined #ruby
royo25 has quit [Quit: Bye]
<seydar> I think I'm going to rent out some AWS space and try running my code over there with the Parallel gem
<nakilon> are your threads finishing at the same time? otherwise I would teach them Array#pop the value from the queue until nil
<nakilon> or using Enumerable and #next, whatever, both is thread-safe I suppose
<nakilon> *are
cahoots has quit [Ping timeout: 268 seconds]
fossdd has joined #ruby
pgib has quit [Quit: 00 PC LOAD LETTER]
cahoots has joined #ruby
<nakilon> also seydar don't do #<< and then #flatten -- instead just do #concat
fossdd has quit [Ping timeout: 240 seconds]
fossdd has joined #ruby
<seydar> nakilon: great point about #concat, thank you
seydar has quit [Quit: leaving]
TorpedoSkyline has joined #ruby
TorpedoSkyline has quit [Changing host]
TorpedoSkyline has joined #ruby
gggp has joined #ruby
Bounga has quit [Ping timeout: 240 seconds]
chonkbit has quit [Remote host closed the connection]
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
jtdowney has quit [Ping timeout: 258 seconds]
reset has joined #ruby
cahoots has quit [Ping timeout: 252 seconds]
fossdd has quit [Ping timeout: 240 seconds]
fossdd has joined #ruby
jtdowney has joined #ruby
cahoots has joined #ruby
lad has quit [Ping timeout: 268 seconds]
orbyt has joined #ruby
cahoots has quit [Ping timeout: 252 seconds]
cahoots has joined #ruby
lad has joined #ruby
cahoots has quit [Ping timeout: 240 seconds]
TorpedoSkyline has quit [Quit: Konversation terminated!]
fossdd has quit [Remote host closed the connection]
fossdd has joined #ruby
qunzhong_luxian has quit [Ping timeout: 268 seconds]
qunzhong_luxian has joined #ruby
cahoots has joined #ruby
lunarkitty has joined #ruby
gggp has quit [Read error: Connection reset by peer]
TomyWork has joined #ruby
<rg> why did no one suggest Ractor?
<adam12> rg: Too experimental.
<rg> fair enough
wei1 has joined #ruby
fossdd has quit [Ping timeout: 240 seconds]
fossdd has joined #ruby
cahoots has quit [Ping timeout: 265 seconds]
TomyWork has quit [Quit: Leaving]
Greg59 has joined #ruby
fossdd has quit [Remote host closed the connection]
cahoots has joined #ruby
fossdd has joined #ruby
fossdd has quit [Ping timeout: 240 seconds]
fossdd has joined #ruby
SuperLag has quit [Quit: leaving]
SuperLag has joined #ruby
jetchisel has quit [Ping timeout: 240 seconds]
Greg59 has quit [Quit: Ping timeout (120 seconds)]
fossdd has quit [Ping timeout: 240 seconds]
fossdd has joined #ruby
justache has quit [Quit: The Lounge - https://thelounge.chat]
justache has joined #ruby
fossdd has quit [Ping timeout: 240 seconds]
fossdd has joined #ruby
aeris has quit [Ping timeout: 244 seconds]
aeri- has joined #ruby
fossdd has quit [Ping timeout: 240 seconds]
fossdd has joined #ruby
fossdd has quit [Ping timeout: 240 seconds]
fossdd has joined #ruby
easbarbosa has joined #ruby
goldfish has joined #ruby
fossdd has quit [Ping timeout: 240 seconds]
fossdd has joined #ruby
SuperLag has quit [Quit: leaving]
SuperLag has joined #ruby
easbarbosa has quit [Remote host closed the connection]
easbarbosa has joined #ruby
fossdd has quit [Ping timeout: 240 seconds]
fossdd has joined #ruby
wei1 has quit [Ping timeout: 256 seconds]
hexreel has joined #ruby
SuperL4g has joined #ruby
xall has joined #ruby
<xall> question for pry users: do long lines automatically use pager?
<xall> it doesn't for me. i've done some searching and it says it should use less by default but it's not happening for me
fossdd has quit [Ping timeout: 240 seconds]
fossdd has joined #ruby
<rg> pager kicks in based on the number of lines, as far as i'm aware. you can try: pry_instance.pager.page "1\n" * 100
<xall> rg: that works. I'm also using amazing_print. when I print an array (out spanning many lines that I would like paged), it doesn't use pager
<xall> i wonder if it's just due to amazing_print
<rg> not sure
<rg> id make sure amazing_print is using Pry::Pager#page.
artemis has joined #ruby
fossdd has quit [Ping timeout: 240 seconds]
fossdd has joined #ruby
pwnd_sfw has quit [Ping timeout: 252 seconds]
<xall> yeah that's the problem
cahoots has quit [Ping timeout: 245 seconds]
pwnd_sfw has joined #ruby
fossdd has quit [Ping timeout: 240 seconds]
fossdd has joined #ruby
ur5us has joined #ruby
<rg> you could probably tweak Pry.config.print to do what you want
fossdd has quit [Ping timeout: 240 seconds]
lad has quit [Ping timeout: 245 seconds]
fossdd has joined #ruby
nullheroes has quit [Quit: WeeChat 3.1]
<xall> `pry_instance.config.print = proc { |output,value| ap value }` didn't work
<rg> yeah because ap is not going to use Pry's pager.
cahoots has joined #ruby
fossdd has quit [Ping timeout: 240 seconds]
fossdd has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
orbyt has quit [Quit: Textual IRC Client: www.textualapp.com]
qunzhong_luxian has quit [Ping timeout: 268 seconds]
goldfish has quit [Ping timeout: 258 seconds]
ur5us has joined #ruby
orbyt has joined #ruby
jmcgnh has quit [Ping timeout: 276 seconds]
motherr has quit [Quit: zzz]
perrierjouet has joined #ruby
perrierjouet has quit [Client Quit]
gcd has joined #ruby
perrierjouet has joined #ruby
rem has quit [Quit: WeeChat 3.2]
lad has joined #ruby
nullheroes has joined #ruby
artemis has quit [Quit: leaving]
artemis has joined #ruby
artemis has left #ruby [#ruby]
Oxfuxxx has joined #ruby
jmcgnh has joined #ruby
hexreel has quit [Quit: nyaa~]
SuperL4g has quit [Quit: leaving]
xall has quit [Quit: Client closed]
xall has joined #ruby
easbarbosa has quit [Read error: Connection reset by peer]
cahoots has quit [Quit: leaving]
SuperLag has quit [Quit: leaving]
SuperLag has joined #ruby
drincruz_ has quit [Ping timeout: 240 seconds]
qunzhong_luxian has joined #ruby
Oxfuxxx_ has joined #ruby
qunzhong_luxian has quit [Ping timeout: 252 seconds]
Oxfuxxx has quit [Ping timeout: 265 seconds]
drincruz_ has joined #ruby
drincruz_ has quit [Ping timeout: 265 seconds]
Oxfuxxx_ has quit [Read error: Connection reset by peer]
Oxfuxxx has joined #ruby
gggp has joined #ruby