On 24 January 2015 at 01:12, Reto Gmür <r...@apache.org> wrote: > Hi Minto > > Thanks for your comments. > >> 1) I am glad you chose to derive from Collections. This opens up the >> > possibility to use Java 8 streams to improve performance especially >> in >> > the filter() method. >> > 2) Hmm, is filter() still required if we can use java 8 streams >> > (collection.stream().filter())? >> > > I think only a dedicated filter method can be implemented perfomantly (i.e. > using indexex). Correct me if I'm wron, but I think with stream().filter() > an implementation would have to apply the function to every triple.
No, that isn't how Stream works. The evaluation is designed to be completely lazy and only perform actions when a terminal operation is executed, at which point the entire sequence of any filters/maps/limits/orders/distinct/etc. is known and it can be optimised completely then. In addition, the Commons RDF specifically does not extend the Collections interface, but it has Stream providing methods. Cheers, Peter --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org