Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #37714
| Newsgroups | comp.lang.java.programmer |
|---|---|
| Date | 2017-12-04 05:32 -0800 |
| References | <321ee28f-bbea-4565-a48e-c0476d9a78d4@googlegroups.com> <ovshh6$8q1$1@dont-email.me> <a7f8b0f0-79cb-4f83-bf77-2ce7d94a2a19@googlegroups.com> <p03i39$n76$1@dont-email.me> |
| Message-ID | <9545f24b-39da-4eab-8c65-365a299b3b2a@googlegroups.com> (permalink) |
| Subject | Re: Can I put a filter into a lambda? |
| From | Eric Douglas <e.d.programmer@gmail.com> |
On Monday, December 4, 2017 at 8:20:59 AM UTC-5, Eric Sosman wrote: > If it *must* be an ArrayList (and not some other kind of List), > you might want to change the last bit to > > .collect(Collectors.toCollection(ArrayList::new)); > > Although the toList() method appears to use ArrayList anyhow, it > doesn't guarantee to do so -- meaning that it might use some other > List in a future Java, or in circumstances I haven't studies (e.g., > it might behave differently with a parallel stream). > ok, thanks, I'll keep that in mind. I'll have to test if the variable can be assigned and if that would be more efficient. Currently it doesn't matter what kind of list because I made the rowToModelIndex variable final, just calling clear() then addAll(). > > Milliseconds do count in a row filtering method which executes thousands of times. > > If performance is important, measure. Don't guess. > Indeed. I am doing test runs with relatively large data sets.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Can I put a filter into a lambda? Eric Douglas <e.d.programmer@gmail.com> - 2017-12-01 12:52 -0800
Re: Can I put a filter into a lambda? Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-12-01 16:28 -0500
Re: Can I put a filter into a lambda? Eric Douglas <e.d.programmer@gmail.com> - 2017-12-04 05:03 -0800
Re: Can I put a filter into a lambda? Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-12-04 08:20 -0500
Re: Can I put a filter into a lambda? Eric Douglas <e.d.programmer@gmail.com> - 2017-12-04 05:32 -0800
Re: Can I put a filter into a lambda? Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-12-04 09:29 -0500
Re: Can I put a filter into a lambda? Eric Douglas <e.d.programmer@gmail.com> - 2017-12-04 07:14 -0800
Re: Can I put a filter into a lambda? Sebastian <nowhere@nirvana.org> - 2017-12-08 15:00 +0100
csiph-web