Hi Sahil, Thanks for your message. A jOOQ Result is an ordinary List, currently backed by an ArrayList. Once you have fetched a Result, it is fully materialised in memory, and thus parallelStream() should be safe.
However, it is likely that there is a much better solution / workaround to your problem. Doing something slow in parallel is not a robust solution. May I ask you to provide some more details to what's going on in those DefaultBinding calls? Perhaps it's just a bug, in case of which, you could report it here: https://github.com/jOOQ/jOOQ/issues/new/choose Thanks, Lukas On Mon, Aug 2, 2021 at 9:26 AM Sahil Takiar <[email protected]> wrote: > Is it safe to call `parallelStream()` on a `Result<Record>` object in jOOQ? > > We have queries where we seen a lot of overhead deserializing results, and > we are looking for ways to reduce that overhead. > > Most of our queries look something like this: > > DSL.using(readOnlyConfiguration) > ... > .fetch() > .stream() > > Java profilers show a lot of overhead in the fetch() method, but not from > executing the actual query, typically in methods like > org.jooq.impl.DefaultBinding.get(BindingGetResultSetContext). > > So, is it safe to replace `stream()` with `parallelStream()`? > > -- > You received this message because you are subscribed to the Google Groups > "jOOQ User Group" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jooq-user/475389a7-5f14-4155-8368-5542fd65a4bfn%40googlegroups.com > <https://groups.google.com/d/msgid/jooq-user/475389a7-5f14-4155-8368-5542fd65a4bfn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/CAB4ELO7kX%3DEn-Cphn%3DEJpXFm3YguJ2W4OBPC5Wf_ioHrHgkkuQ%40mail.gmail.com.
