I am trying to squeeze out the last little bit of performance from a backend pipeline application. I am storing rules in Couchbase. These rules are simple POJOs with mostly name value pairs serialized with GSON to store in couchbase.
I query a view and get a response with rows.
if (response != null{
for (ViewRow row : response) {
DOC_RuleDefinition drd = new DOC_RuleDefinition();
drd = gson.fromJson((String) row.getDocument(), DOC_RuleDefinition.class);
ruleDefinitions.add(drd);
}
}
This works just fine, but it costs me 10-20ms each time. Is it worth it? Is there a faster way? I mean is there a way to skip the instantiation and population of the pojo and just get the values directly from the json string?
MO