I'm on a mission to find every Enum.each/2 in the tooling I use and replace it with Task.async_stream/2 😁
I'm on a mission to find every Enum.each/2 in the tooling I use and replace it with Task.async_stream/2 😁
@tylerayoung thank you for sharing. Looking forward to see its effect in my project.
I’m just a bit confused after I saw this issue:
“[...] the two maintainers no longer work at NCC Group and due to organization policies, we were inexplicably removed from maintaining this repo with no path forward to continue work here. So we have decided to fork the repo in an organization we actually can manage.”
https://github.com/nccgroup/sobelow/issues/182
Were you aware of that?
Your PR still got feedback from one of them.
@sesamzoo Oh! I did not know this... uh... huh. Yeah, I definitely opened the PR against the wrong one.
@tylerayoung I believe, like with Stream.each, that you have to get above a certain quantity of data or complexity of operation before you see performance benefits from the change.
@j3rn Yes, there’s an overhead for Stream module’s functions. The PR is not (mainly) about replacing Lists by Streams, though. It’s about the "async_“ part, i.e. applying the function concurrently instead of sequentially to each of the Enumerable’s elements. Also with overhead but @tylerayoung shared the performance improvements (runtime) he measured in his project, too.