The response is coming as a JSON which is around 230KBs. We are using a javascript to convert the JSON into a format that makes it around 1.6MB. During this conversion, the JSON.Stringify operation alone is consuming around 100ms. (The total time taken by the policy is in the range 80ms-200ms) Is there any way to reduce the time?
If you can use node.js,you might want to consider using the JSONStream package. JSON.parse and JSON.stringify do have performance impacts (esp. when dealing with large payloads). When dealing with large documents, streaming can help.
There are options discussed in this link on how to optimize performance of json.Stringify :
https://github.com/svaarala/duktape/issues/204
for your consideration.