<headius[m]> god I hate C sometimes
<headius[m]> the transcoding paths are rough passing bytes through
<headius[m]> CRuby uses Ruby objects as carriers for everything
travis-ci has joined #jruby
travis-ci has left #jruby [#jruby]
<travis-ci> jruby/jruby (master:5434394 by Charles Oliver Nutter): The build passed. https://travis-ci.com/jruby/jruby/builds/218644343 [209 min 0 sec]
<headius[m]> hmmm code range
<headius[m]> would help short circuit some paths here
<headius[m]> amazing how much the CRuby C code boils away if you inline a bunch of stuff and optimize for common paths
<headius[m]> they overload these methods SO bad
<headius[m]> huh I think I have it
<headius[m]> ok... copy_stream does not go through this logic, or at least does not make use of this fast path because it only uses IOOutputStream if the target is not an IO
<headius[m]> IOOutputStream is used by the Psych ext to wrap target IO for dumping (passed to SnakeYAML), for stdout and stderr streams provided by Ruby.getError/OutputStream, by Marshal for dumping to a target IO or IO-like, by GzipWriter for writing to a stream, and of course anyone that calls to_outputstream on an IO
<headius[m]> hmmm might be a use case for this in the IOChannel faker
<headius[m]> ahh but that is only used when it is not a real IO anyway so no benefit
<headius[m]> ok
<headius[m]> jswenson: ^
<headius[m]> I only have write implemented so far and there will be further optimization there too
<jswenson[m]> That’s awesome! looking forward to this.
nirvdrum has quit [Ping timeout: 245 seconds]
nirvdrum has joined #jruby
<enebo[m]1> kares: whenever you want to talk about extension API yak shave I should be available
<headius[m]> woot, fast path writes can now avoid all allocation
<headius[m]> slow path writes with transcoding will also allocate several fewer objects
<headius[m]> enebo: I almost have read side of this PR done and then I will review your arity stuff
<enebo[m]1> headius: I just reviewed that IO PR. A few pretty unimportant comments.
<headius[m]> enebo: ok
<headius[m]> pushing read stuff shortly after some smoke tests
<headius[m]> read was substantially easier than write because most of the transcoding happens downstream from the byte[] logic
<headius[m]> write with transcode could probably be improved to use allocated-once buffers more but it is an uncommon use case
<headius[m]> I wish Java IDEs gave some visual indication that a call is self-recursive
<headius[m]> how many times do I have overloads that accidentally call themselves
<enebo[m]1> if (array.size() == 0) array = RubyArray.newEmptyArray(context.runtime);
<enebo[m]1> So we have a normal block dispatch and it gets an empty array. We then make a new empty array. This is for a proc which expects a single required argument
<enebo[m]1> So I guess proc { |c| }.call(*[])
<enebo[m]1> oh wait this is weirder than I thought
<headius[m]> why does it make a new array
<enebo[m]1> yeah that was why I pasted it there
<headius[m]> oh I suppose it dups normally?
<headius[m]> to avoid *args on receiver writing into some source array
<enebo[m]1> if I do arr = []; call(*arr) to not get the []?
<enebo[m]1> I will try that
<enebo[m]1> hmm
<enebo[m]1> oh I should add this only comes from the weird cases of us doing .call with NORMAL (which is done a few places I mentioed yesterday) and for yieldSpecific
<enebo[m]1> so in yieldSpecific it would be some internal caller passing in an empty ruby array.
<enebo[m]1> and we do not want it poisoned by being bound to the proc variable
<enebo[m]1> which I would argue should not be in the place but back at the caller
<headius[m]> hmm ok
<enebo[m]1> the call path with NORMAL blocks should not be going through call at all but that is also all internal callers or indirected through Java wrapped mechanisms for calling Ruby blocks
<enebo[m]1> but it is a very very narrow case. You pass a single [] to a normal block or internal consumer with a proc which has one required value
<enebo[m]1> I am going to remove it and see what happens but it looked weird enough to immediately paste it into channel :)
<enebo[m]1> Once I split this helper into the two paths these methods are very similar
<enebo[m]1> <#<Errno::EOPNOTSUPP: Operation not supported - No message available>>.
<enebo[m]1> weird. Never seen that fail in test:mri.
<headius[m]> hmmm
<headius[m]> anything else?
<headius[m]> might be some fcntl or ioctl error
<enebo[m]1> This is on my green branch except for some small changes I have been making
<headius[m]> read support is pushed
<enebo[m]1> cool
<headius[m]> there's gobs of low hanging perf fruit though this whole IO pipeline
<headius[m]> these changes also will reduce some alloc for non-fast path
<enebo[m]1> It would be real fun to see some dark matter come out of this
<enebo[m]1> I mean let's face it there is a lot of IO in the world
<enebo[m]1> I am just not sure how much more IO will hit this specific code
<enebo[m]1> but Rails marshals
<headius[m]> yeah it is hard to measure because these are all tiny transient objects
<headius[m]> it all gets cleaned up in eden space so hard to see a straight-line improvement, but lots of concurrent usage will start to overload alloc and GC
<headius[m]> at least alloc on these paths is drastically reduced, which is always a win
<enebo[m]1> yeah I guess it could help in places where memory is tighter at a minimum
<enebo[m]1> small eden space means more frequent activity
lanceball has quit [Ping timeout: 256 seconds]
lanceball has joined #jruby
<enebo[m]1> passed second time
<enebo[m]1> some spurious thing
<headius[m]> hmm ok
<headius[m]> gotta love it
<headius[m]> got a good one this time
<headius[m]> oops
<headius[m]> enebo: looks like PR will go green shortly and I have marked it ready
<headius[m]> enebo: YAML reads from a stream also go through the read logic, so that is more wasteful bytelists and strings eliminated
<enebo[m]1> looks ok to me
<enebo[m]1> Or I should say nothing leapt out
<lopex> if it affects the numbers, ship it
<headius[m]> numbers!
<enebo[m]1> lopex: !!!!!!!!!!!!!
<headius[m]> numbers of wasted objects for sure
<lopex> long time no see
<enebo[m]1> lopex: I knew it took numbers to bring lopex back
<enebo[m]1> lopex: hope you are doing well
<lopex> enebo[m]1: not too bad
<lopex> bleh must be timed out on matrix
<lopex> always forget how to rejoin
<headius[m]> enebo: ok so .16, anything else needed to get it out?
<enebo[m]1> no
<enebo[m]1> I guess I will build bits tomorrow morning
<enebo[m]1> 1 week strides!
<enebo[m]1> I kid. I hope nothing is reported for a while this time around
<enebo[m]1> then next thing will be 9.3
<headius[m]> no doubt
<enebo[m]1> headius: so you going to review that arity PR?
<headius[m]> yeah going through some triage and then arity PR is next
<lopex> headius[m]: btw joni had a new release inbetween
<lopex> wrt that g pos
<headius[m]> oh yes
<headius[m]> is that a Ruby 2.5 thing we should update for .16?
<lopex> but not tested in jruby though
<lopex> well, it;s quite old anyways
<headius[m]> hmm yeah what do you think of updating joni and jcodings enebo
<enebo[m]1> why?
<lopex> jcodings should be ok but no idea about joni
<enebo[m]1> well that sells it for me...no :)
<enebo[m]1> unless it is fixing something specific reported and is not risky it should just be a carrot for 9.3
<lopex> of that gpos never failed then it probably is not in jruby tests
<lopex> yeah, so for now lets say no
<headius[m]> ok
<lopex> I'd say it's noninvasive but nontheless
<headius[m]> yeah trying to keep risk down on these 9.2 updates
<headius[m]> maybe this should just be the release list and we post twice, first with a "heads up" some days before we proceed
<headius[m]> I don't know how to manage this process cleanly since we have no set workflow for prerelease tasks
<headius[m]> I guess this could also just be the JRuby mailing list... prerelease announce around when we start talking about it
<enebo[m]1> yeah that is the right course
<headius[m]> I have been doing prerelease tweets sometimes but nothing formal
<enebo[m]1> for a release if we actually know it will be in a couple of weeks or a week we can post a message to the list
<enebo[m]1> headius: yeah and usually within like 6 hours of it
<headius[m]> kalenp: we can try to get prerelease announcements out in the future on the JRuby mailing list... seem ok?
<headius[m]> I will mention this on the issue
<headius[m]> enebo: yeah it is more like "watch your head"
<enebo[m]1> perhaps jruby should put those out as part of the process once we know it will be coming but maybe be really squishy
<enebo[m]1> like we think we will be doing it in next couple of days or early next week
<lopex> were there any docker/alpine/musl issues lately ?
<kalenp[m]> mailing list works for me!
<lopex> bleh
<headius[m]> kalenp: perfect
<headius[m]> lopex: not for a while now
<headius[m]> we should probably try to get more musl into CI somewhere
<headius[m]> at least jnr-posix and friends
<lopex> last time I got bit by it was ldap afaik
<lopex> but always ponder what distro to choose for deployment
<headius[m]> or anyone else who wants to give it a go
<headius[m]> just a matter of using correct enum methods to acquire elements from an Enumerable-like passed to Set constructor
travis-ci has joined #jruby
travis-ci has left #jruby [#jruby]
<travis-ci> jruby/jruby (master:a7f1480 by Charles Oliver Nutter): The build has errored. https://travis-ci.com/jruby/jruby/builds/218781532 [210 min 23 sec]
<headius[m]> no
<headius[m]> is J9 just running too long? Maybe we need to turn on some output there.
<lopex> who uses j9 anyways
<headius[m]> AIX users
<headius[m]> 😀
travis-ci has joined #jruby
<travis-ci> jruby/jruby (weakref_spec_fix:c4ae884 by Charles Oliver Nutter): The build was canceled. https://travis-ci.com/jruby/jruby/builds/218783998 [18 min 30 sec]
travis-ci has left #jruby [#jruby]
<headius[m]> enebo: I did not see any issues scanning through your PR
<headius[m]> three places the license block reformatted for no reason
<headius[m]> and suggested checking if any Arity imports can be deleted