Performance issues using cursor.toArray()

I am using cursor.toArray() to return collection.find(query)as list, the response time for my API is in 100’s of milliseconds. Data fetched into the cursor is very less (a couple of hundred records), the database is indexed on the field I am querying. I have also set the batch size. I tried profiling the database for the same query and response time is good (5 ms), I see huge latencies when queried through my application. I am using the latest version of org.mongojack as my driver. I can post further investigation and tuning I have done and actual application code if needed. MongoDB instance is configured with Rocksdb storage engine and running in an EC2 instance.