Harmeet Singh Taara
Harmeet Singh Taara

Reputation: 6611

Performance Tuning Libraries and Java 8 Stream Libraries

There are lots of java third party libraries are available for provide high performance in Java Collection. According to this DZONE Article, there are some native libraries that follow OSGI model and provide high performance in Java Collection or also perform some others action. Now in Java 8 the Streams are launched for provide good performance in collection libraries and we also perform some parallel actions using Streams. Now, Following are my questions:

  1. Is Java Streams have better performance then third party libraries like Trove, Javolution etc.
  2. Is is possible to use Java 8 Streams with other collection libraries ?

Upvotes: 4

Views: 802

Answers (1)

leventov
leventov

Reputation: 15303

  1. Trove primitive collections even not a part of Java Collections Framework (the don't implement Collection, List, Map intefraces), though it doesn't prevent them from providing streams API in principle.

  2. Trove, Javalution and most other collection libs I'm keeping track of don't support efficient stream implementations yet. They don't override spliterator() method to return a Spliterator implementation which should override trySplit() method to take advantage of parallel stream features.

  3. As I mentioned here: Java 8: performance of Streams vs Collections Streams are not a silver performance bullet, they may significantly help only if you haven't processed your huge collections in parallel yet, but don't have obstacles to do it using parallel streams.

Upvotes: 3

Related Questions