<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]
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]