If anyone is free at all I’d like to solicit some ...
# arrow-contributors
t
If anyone is free at all I’d like to solicit some advice on https://github.com/arrow-kt/arrow-fx/pull/279. I’m trying to add
parMapN
up to arity 9 but I’m running into some issues 1.
ParTupledN
has a huge amount of lag for me in intellij once I kind of scaffolded out the new functions. To the point it’s basically impossible to use intellij to edit that particular file. I haven’t been able to find a solution for that on my own (looks like the the kotlin plugins type checker freaks out when code analysis runs, so anytime anything is edited on the page). I don’t know if its just me, but if it isn’t, is this code new enough that I can split it into multiple files (it’s getting a bit big anyway). I would hope that might help, but its just a guess. 2. Many of the arrow coroutine tests hang indefinitely for me when running the tests locally (though they appear to work in the builds on the PR, such as https://github.com/arrow-kt/arrow-fx/actions/runs/243281626 ) Is this another me problem or is there something weird happening? 3. I’m adding some tests for parMapN for arity 2 and 3 (since it already exists), but it looks like arity 3 was failing one of the tests
"parMapN 3 cancels losers if a failure occurs in one of the tasks"
. When messing with the test I found that putting the winner in the third position always caused a hang, so I updated
parMapN 3
to use
parMapN 2
instead of the existing implementation of
parMapN(ctx, fa, fb, fc, f)
and it appears to have fixed it. Is that correct or is there a reason to definitely be using the stand alone implementation of N = 3 instead of composing with N = 2? Any suggestions appreciated! Thanks!
p
Does it help performance to split it to separate files?
t
^ I haven’t tried yet but when trying to debug it that was one of the recommendations I saw (and it looks like I don’t get any of the lag at all when using the functions from that file in another file). I can give it a try in a bit and let you know!
From the hanging it looks like I’m seeing it a lot whenever
evalOn
is used in the tests. so this hangs
Copy code
checkAll {
  single.zip(mapCtx).use { (_single, _mapCtx) ->
    evalOn(_single) {
    }
  }
}
and this does not
Copy code
checkAll {
  single.zip(mapCtx).use { (_single, _mapCtx) ->

  }
}
Just tried moving the new parMapNs out to their own file and its still laggy but noticable better for me. They may improve even more putting them into their own files, but still not sure if this is just a local dev thing for me. I’m not sure it makes sense to put each of them in their own file.
r
It makes sense to me. About testing, Arrow Fx Coroutines is the first module that is using Kotest for testing (the rest of modules are still using KotlinTest) and I also have issues in my local environment with those tests. Any improvement in that sense is welcome!
t
Cool! It looks like im down to only one failure in the build on the PR (which might be flaky but i’ll have to take a look). This PR is getting a little big so I might arbitrarily draw the line somewhere and finish the rest in another PR. I’ll let you all know when it is ready for review!
r
Yes, there are flaky tests in that module 👍 Thanks @tavish pegram 🙌