<adam12>
hwrd: Hard to say with just looking at that gist. Heavily loaded system? A lot of IO where the task is blocking and rescheduled later? etc.
<hwrd>
shouldn't be loaded. it's my M2 Pro Macbook and I've shut everything off.
<gr33n7007h>
hwrd: what you benchmarking with them sort of times?
<hwrd>
gr33n7007h: a data transform job that basically crunches through an entire table. this run is just of 50k rows though, which is why it's alarmingly slow.
<gr33n7007h>
yeah, crazy. one is like 9+ minutes =(
<hwrd>
there's some contention somewhere. if I run 1000 rows, it's 3 seconds, which isn't fast but look at this benchmark
<hwrd>
a: 0.489387 0.028311 0.517698 ( 3.239487)
<hwrd>
why is it 3.2 seconds when the total runtime is half a second?
<gr33n7007h>
hwrd: user = user space cpu time (e.g. program code) | system = kernel space cpu time (syscalls) | total = user + system | real = elapsed time (clock_monotic) executing the block of code
pgib has joined #ruby
<hwrd>
gr33n7007h: right, but how can i troubleshoot why real is 6x total time here?
<adam12>
hwrd: See if you can profile using something like rbspy.
<adam12>
hwrd: or vernier.
<adam12>
They both should be able to give you a flamegraph and you can see where you stand from there. I'm presuming that it's because the kernel has offloaded you for something IO related and the actual execution of your Ruby program was fairly short.
<hwrd>
awesome, thank you. will check those out
razetime has joined #ruby
user71 has joined #ruby
the9ine has joined #ruby
Axenntio has quit [Quit: Axenntio]
Aminda has quit [Remote host closed the connection]
Aminda has joined #ruby
razetime has quit [Quit: Go back to your cringe 9 to 5. I'll be gaming.]
donofrio has quit [Quit: Leaving]
c10l5 has joined #ruby
c10l5 has quit [Remote host closed the connection]
c10l5 has joined #ruby
JordiGH has joined #ruby
the9ine has quit [Quit: Connection closed for inactivity]
osc4rpt has quit [Ping timeout: 252 seconds]
osc4rpt has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
aesthetikx has quit [Ping timeout: 256 seconds]
dviola has quit [Ping timeout: 260 seconds]
ghostbusters2 is now known as ghostbuster
milouse has joined #ruby
aesthetikx has joined #ruby
donofrio__ has quit [Ping timeout: 255 seconds]
donofrio_ has quit [Ping timeout: 264 seconds]
_ht has quit [Remote host closed the connection]
donofrio has joined #ruby
donofrio_ has joined #ruby
user71 has quit [Quit: Leaving]
<adam12>
Tempted to stash a giant object into Rack's env to smuggle a few layers down but it feels just such a hack :|
user23 has joined #ruby
<weaksauc_>
come to the dark side adam12
<adam12>
LOL
<adam12>
I'm trying to preserve the interface of `.call(env)` but it's getting in my way.
<[0x1eef]>
IIRC Rack supports something like that. I think omniauth use it, and I've seen other objects hanging around there, usually namepsace 'foo.bar'.
<[0x1eef]>
It looks like a pattern that's somewhat common.
<adam12>
I'll check out what omniauth is doing.
<adam12>
I feel like I want a new context object of some sort, but it breaks that interface so I am not sure.
<[0x1eef]>
omniauth appear to store an instance of Omniauth::Strategy as @env['omniauth.strategy']. And only on some auth condition. It seems like an alright approach to me if you're doing that kind of thing.
<adam12>
RequestContext = Data.define(:application, :request, :response, :session) style. What I want is to introduce the `application` here as a local since it's currently a global/singleton :|
<[0x1eef]>
Same in Rails, right? Rails.application.
<adam12>
Maybe I can use a delegator. I'll wrap the env hash with my own pieces.
<adam12>
Yeah. But I don't like the Rails way :P
<[0x1eef]>
I mean, it sounds nice to have isolated applications but there's probably more practical problems to solve.
<adam12>
I've done a lot of work to isolate these. It's the last remaining piece, really.
<adam12>
Which I can solve by smugging inside `env` but it just seems like the easy way out.
milouse has left #ruby [#ruby]
<adam12>
Going to have to think on it some more.
Linux_Kerio has quit [Ping timeout: 260 seconds]
ftajhii has joined #ruby
milouse has joined #ruby
milouse has left #ruby [#ruby]
donofrio has quit [Ping timeout: 264 seconds]
ruby[bot] has quit [Remote host closed the connection]