1
I see that the use of stream Java 8 is recommended for large amount of data. If the data set is small, there is some gain from using only Collection
?
1
I see that the use of stream Java 8 is recommended for large amount of data. If the data set is small, there is some gain from using only Collection
?
2
The stream was not created to improve something according to the amount given. It exists to give more expressiveness, and supposedly legibility. So your code should be clearer, and simple in dicado what you want without worrying about how to do it. It’s a way to make language more declarative and less imperative.
If you’re thinking about performance then the stream is bad, especially with large volumes, because with small all performance is acceptable.
Browser other questions tagged java performance java-8 stream
You are not signed in. Login or sign up in order to post.
Let’s say I don’t want to process all this data as a Collection
– renanvm
Again, the stream was not created for this, you can do the same without stream, will only be more verbose and risk more, no matter the amount of data, or whether it will be partial or not. The stream was not created to process something partial, this is something of some specific algorithms that have already created in the stream, several of them is even possible to partially execute.
– Maniero
Maniero which is the sort algorithm used in streams?
– ayowole agbedejobi
@ayowoleagbedejobi I don’t know what you’re talking about, it’s without context.
– Maniero
@Maniero In this case I use the sort method called 'Sorted' in Stream, only I don’t know the sort algorithm that is used when invoking this method and if it is an efficient algorithm.
– ayowole agbedejobi
If this doubt of mine escapes the scope of this question let me know that I create another question.
– ayowole agbedejobi
@ayowoleagbedejobi Ok, you use a method among them that makes classification of the collection. I can not say what it is, because it should be an implementation detail, but the subject here is not about this, can ask a question and who knows can answer.
– Maniero