I'm using the method below and it takes lots of time (about 10 min.) when the list have about 1000 elements.If the list has 1 element, it takes 100ms Is there a way for improving the performance?
List<Book> books = Optional.ofNullable(library.getOnlineBooks).map(
onlineBooks-> onlineBooks.stream()
.filter(Objects::nonNull)
.map(onlineBook->
searchCopys.search(onlineBook.getTitle())
.map(copys-> BookCreator.create(onlineBook, copys)
).block())
.collect(Collectors.toList()))
.orElse(Collections.emptyList())
Mono<Book> BookCreator create(OnlineBook onlineBook, Copys copys){
}
Mono<Copys> SearchCopys search(String title){
}
Thanks