Json parser performance boost#491
Conversation
ded82ca to
8544582
Compare
|
@gerashegalov, do you know who the best person to contact for review? |
|
@isnotinvain can you take a look, please ? |
| jsonGenerator.writeObject(jsonParser.getEmbeddedObject()); | ||
| break; | ||
| default: | ||
| throw new IOException("Cno"); |
There was a problem hiding this comment.
Agreed. Should have a better exception message
| Map<String, String> result = udf_.exec(input); | ||
| assertTrue("It should return a Map", result instanceof Map<?, ?>); | ||
| assertEquals("value", result.get("name")); | ||
| assertEquals("\"value\"", result.get("name")); |
There was a problem hiding this comment.
why we got here additional quoting?
There was a problem hiding this comment.
extra quoting seems like exactly what we'd want to make sure isn't happening, so it'd important to sort that out. We would need this upgrade to be transparent to users, we can't have it behave differently.
There was a problem hiding this comment.
jasonsimple is parsing and removing the quotes and leaving a bare string as the value. this is something to figure out.
| return null; | ||
| protected Map<String, String> parseStringToMap(String line) throws IOException { | ||
| JsonParser jsonParser = jsonFactory.createParser(line); | ||
| jsonParser.nextToken(); |
There was a problem hiding this comment.
A nextToken is needed to advance to the first element. perhaps this could be done is a less hard coded way
I have created a test that shows that the new faster xml jackson library parser API can be taken advantage of in this case (and perhaps other elephant bird cases). My tests results shows 2x speed boost for typical deeper json hierarchies. The drawback here is the upgrade of the jackson library from 1.x line to 2.x line