High latency in benchmarking while using Map to store data


I am doing benchmarking (my own scripts) using map as data structure. I am storing map with 10 keys inside a bin. I am observing high latency for it (1.2% is greater than 1ms). Following are details about benchmarking set-up

  1. replica factor = no
  2. Using no persistence
  3. Aerospike has 1 Million keys.

Latency Observed are 1ms: 98.8, 2ms: 0.3 , 3ms: 0.17, rest: 0.73

While running custom benchmark, latency was observed to under 1 ms for 100% requests.

Code to generate bin with map is

 HashMap<String,String> map = new HashMap<String,String>();
        for (int index = 0; index < totalBins; index++) {
            map.put("key" + index, "value" + index);
        return new Bin[]{new Bin(binName, map)};

Can someone tell if this is expected or we can have latency under 1 ms for 100% of requests for map as data structure?

What is the difference between the two benchmarks where you got 100%<1ms and 98.8%<1ms ?

How are you calculating the latency ? Does the latency include the time taken to build the java map ? Or are you calculating only the time taken for the pure get/put call ? One thing that happens under the hood when using list/map is that conversion from java list/map object to a message packed binary format. This can consume extra time which may be effecting your latencies.

Also please check the latencies as seen by the server. If you see the logs, we print the latency histogram for the reads & writes. Most likes it will be under 1ms. I am guessing the client and the network is causing the extra latencies.