To maintain backward compatibility in our code, we want to convert CompletableFuture to Flowable(for get, it should be Single, but the code was written in that fashion). This is how we have written the code but it is taking around 30-40ms for the get call. Any suggestions to improve the same ? The same code is getting executed for around 1M request while doing the performance testing.
Flowable.fromFuture(primaryAsyncBucket .defaultCollection() .get(key, GetOptions.getOptions().withExpiry(true).retryStrategy(FailFastRetryStrategy.INSTANCE))) .map(getResult -> new JsonDocument(key, getResult.contentAsObject(), getResult.cas(), getResult.expiry().get())) .switchIfEmpty(Flowable.error(new NoSuchElementException(key + " Not Found")));
The results are not from cold boot. The JVM is warmed up with around 50000 requests before starting the test. The test are ram on OpenJDK 11, RxJava3, Vert.x and Couchbase server version 6.6