This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
I'd start by implementing the simplest solution - that is, iterating over the lists and picking up the items that meet the criteria. Then measure the performance. If and only if it turns out to be a bottleneck of your application, start thinking about how to improve it.
Andreas Hollmann
Greenhorn
Joined: Jan 06, 2010
Posts: 27
posted
0
look at filter() method from Collections2 of google-guava library.
Andreas Hollmann
Greenhorn
Joined: Jan 06, 2010
Posts: 27
posted
0
also if you want to increase the performance of your list you can use SortedList decorator of happy-library.
Martin Vajsar wrote:I'd start by implementing the simplest solution - that is, iterating over the lists and picking up the items that meet the criteria. Then measure the performance. If and only if it turns out to be a bottleneck of your application, start thinking about how to improve it.
I agree, with one caveat...You need to have defined, measurable criteria for what is "fast enough" BEFORE you do the tests. Defining that sort of thing after you've run your tests is pointless.
It seems like all far too often, if these things aren't defined ahead of time, it doesn't matter what the results are, someone will say "That's not fast enough". So, you define the requirements FIRST, and then work to meet them.
Never ascribe to malice that which can be adequately explained by stupidity.